Hello, i have a script that welds something to players hand. It works well but however it isn’t repeating after player dies.
The print that checks if script is working are working good but object is gone.
How do fix???
local sword = game.ServerStorage.Sword:Clone()
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
game.ReplicatedStorage.SwordEquipped.OnServerEvent:Connect(function()
local handle = sword:WaitForChild("WeldPart")
sword.Parent = character
local Weld = Instance.new("Weld", sword)
Weld.Name = "Weld"
Weld.Part0 = handle
Weld.Part1 = character["Right Arm"]
end)
game.ReplicatedStorage.SwordUnEquipped.OnServerEvent:Connect(function()
sword.Parent = nil
end)
end)
end)