When I reset I cannot re-quip my weapon, Am I doing something wrong?
Asked by
5 years ago Edited 5 years ago
So whenever I reset I get the BackSword Welded just fine but I cannot Equip after reseting/dying
Local Script:
01 | local player = game.Players.LocalPlayer |
02 | local repStorage = game.ReplicatedStorage |
03 | local playerChar = player.Character or player.CharacterAdded:Wait() |
05 | local function activate() |
06 | if not playerChar:FindFirstChild( "BackSword" ) then |
07 | playerChar.HandSword:Destroy() |
08 | repStorage.SwordBack:FireServer() |
09 | elseif playerChar:FindFirstChild( "BackSword" ) then |
10 | playerChar.BackSword:Destroy() |
11 | repStorage.Sword:FireServer() |
15 | game:GetService( "UserInputService" ).InputBegan:Connect( function (input, isTyping) |
16 | if isTyping then return end |
17 | if input.KeyCode = = Enum.KeyCode.One then |
ServerScript:
01 | local Swprd = game.ServerStorage.HandSword |
02 | local repStorage = game.ReplicatedStorage |
03 | local remote = repStorage.Sword |
05 | remote.OnServerEvent:Connect( function (plr) |
06 | local SS = Swprd:Clone() |
07 | local weldPart = SS.WeldPart |
08 | local char = plr.Character or plr.CharacterAdded:Wait() |
09 | local LH = char.WeldPart |
11 | local weld = Instance.new( "Weld" , char) |
15 | weld.Parent = weldPart |