Thank you, in advance, for the help :) So I created a "swordSummoning" (local) script located in StarterPlayerScripts. It's meant to equip the user with a sword once the 'r' key is pressed. Each time the function is called, the sword appears for about a second or two, then completed disappears. On top of that, the sword's "handle" does not appear.
Here is the code within the Summoning script:
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
hasSword= false
Mouse.KeyDown:connect(function(Key)
if Key == "r" and hasSword == false then --If the key is pressed and player does not have a sword
hasSword= true --Make the hasSword variable true
clone = game.Lighting.Sword:Clone() --Create a clone of the sword
clone.Parent = game.Players.LocalPlayer.Character --Put the sword on the character
print("Worked") --Print "Worked" for assurance
else --If you do have the sword
clone:Destroy() --Remove it
hasSword= false --Make it false
end
end)
I tried to get rid of this...:
else --If you do have the sword
clone:Destroy() --Remove it
hasSword= false --Make it false
...but nothing changed. I still got the same problem. So I'm starting to think that it doesn't have anything to do with the Summoning script
Question: Is the script the problem? If yes, how can I fix the script?

1 comment
You should never use Mouse.Keydown! It's deprecated!