Sungmingamerpro13

BeamScript

Jul 20th, 2025
1,157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.69 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local beam = script:WaitForChild("Beam"):Clone()
  3.  
  4. local function pathToPart(beam, a0, part) --Function to make making paths easier
  5.     local a1 = part:FindFirstChildOfClass("Attachment")--Find the attachment in the part
  6.     if a1 then
  7.         beam.Attachment0 = a0
  8.         beam.Attachment1 = a1
  9.     else
  10.         warn("No attachment was inserted into "..part:GetFullName())
  11.     end
  12. end
  13.  
  14. plr.CharacterAdded:Connect(function(char)--Every time player respawns, connect beam again
  15.     local root = char:WaitForChild("HumanoidRootPart")
  16.     local a0 = root:WaitForChild("RootRigAttachment")
  17.     pathToPart(beam, a0, workspace.Canrinel:WaitForChild("HumanoidRootPart"))
  18.     beam.Parent = char
  19. end)
  20.  
Advertisement
Add Comment
Please, Sign In to add comment