I’m trying to weld this part to the players hand, but the issue is that it does quite the opposite; While still being attached to the arm in the sense that it moves along with it, the part is always on some spot far away from where I intended it to be on (It’s on the sky in this example).
I’ve tried this with both regular Welds and WeldConstraints.
Here is the script (This is the only bug in this code for clarification, )
local ServerStorage = game:GetService("ServerStorage")
local lightningParticle = ServerStorage:FindFirstChild("lightningParticle")
local lightningLight = ServerStorage:FindFirstChild("lightningLight")
local streamSound = ServerStorage:FindFirstChild("streamSound")
local lightningStream = ServerStorage:FindFirstChild("lightningStream")
local streamEvent = game.ReplicatedStorage:FindFirstChild("Stream")
local debounce2 = {}
game.Players.PlayerAdded:Connect(function(player)
local cooldown = tick()
debounce2[player.Name] = 1
end)
streamEvent.OnServerEvent:Connect(function(player)
if (tick() - debounce2[player.Name]) > 10 then
debounce2[player.Name] = tick()
local humanoidRootPart = player.Character.HumanoidRootPart
local hand = player.Character.RightHand
local particleClone = lightningParticle:Clone()
particleClone.Parent = humanoidRootPart
local lightClone = lightningLight:Clone()
lightClone.Parent = humanoidRootPart
local streamClone = lightningStream:Clone()
streamClone.Weld.C0 = streamClone.CFrame
streamClone.Parent = hand
streamClone.Weld.Part1 = hand
streamClone.Weld.C1 = hand.CFrame
local soundClone = streamSound:Clone()
soundClone.Parent = humanoidRootPart
soundClone:Play()
game.Debris:AddItem(particleClone, 5)
game.Debris:AddItem(lightClone, 5)
game.Debris:AddItem(streamClone, 5)
game.Debris:AddItem(soundClone, 5)
end
end)