Each time a player resets or dies they loose their sword. I need this to stop because this is a fighting game and loosing your sword after dying would be really sad.
local Swprd = game.ServerStorage.BackSword
local repStorage = game.ReplicatedStorage
game.Players.PlayerAdded:Connect(function(plr)
local SS = Swprd:Clone()
local weldPart = SS.WeldPart
local char = plr.Character or plr.CharacterAdded:Wait()
local HMR = char.Torso
SS.Parent = char
local weld = Instance.new("Weld", char)
weld.Name = "Welder"
weld.Part0 = HMR
weld.Part1 = weldPart
weld.Parent = weldPart
end)
That is the server script for when they enter
local player = game.Players.LocalPlayer
local repStorage = game.ReplicatedStorage
local playerChar = player.Character or player.CharacterAdded:Wait()
local function activate()
if not playerChar:FindFirstChild("BackSword") then
playerChar.HandSword:Destroy()
repStorage.SworBd:FireServer()
elseif playerChar:FindFirstChild("BackSword") then
playerChar.BackSword:Destroy()
repStorage.Sword:FireServer()
end
end
game:GetService("UserInputService").InputBegan:Connect(function(input, isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.One then
activate()
end
end)
That is the local script (there are two remotes one that does the same thing as the first script I showed and another remote that gives the player the HandSword)

6 comments
Try putting it in startergear your tools
They are models not tools
Oh
I suggest asking these types of questions on the dev forums...
Maybe just add the tool every time u respawn?
so basically you want the sword to weld to the character each time they respawn?