Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I get Instance.new("Attachment") to connect a beam?

Asked by 5 years ago
Edited 5 years ago

I'm trying to make it so that when I click on the basicGrave it creates a new attachment with Part1 as the parent and updates my Beam in game.StarterPack.starterTool.Handle's attachment0. The script I have below creates the attachment, assigns its location/parent, and updates the Beam but produces no beam effect. If I do this manually without the script then it works just fine.


script.Parent:WaitForChild("ClickDetector").MouseClick:Connect(function(plr) if script.Parent.Name == "basicGrave" then if plr:FindFirstChild("leaderstats") then local vacuumBeam = Instance.new("Attachment") vacuumBeam.Parent = script.Parent.Part1 vacuumBeam.Position = Vector3.new(vacuumBeam.Parent.Position.X,vacuumBeam.Parent.Position.Y,vacuumBeam.Parent.Position.Z) game.StarterPack.starterTool.Handle.Beam.Attachment0 = vacuumBeam end end end)
0
You know, instead of using .X, .Y, and .Z you can just put Vector3.new(vacuumBeam.Parent.Position) ? User#19524 175 — 5y
0
When I do that the location of the created attachment becomes 0,0,0 Bixxith 0 — 5y

Answer this question