Hi! I'm having an issue here that I have no clue how to fix. I'm not sure if it's a problem with my scripting or just a problem with my game settings. Anyway, I was eventually able to make a script that gave a player a sword and teleported them into a map. Same with a bomb. Both of these clone into the player's inventory successfully and work okay in "Play solo." However, the sword stops working if you run and swing sometimes. I just thought It was a problem with R15 because the bomb worked fine. If you upload the game to roblox or you do a server test, the tools do not work at all. Here is my script:
local button = script.Parent
local player = game.Players.LocalPlayer
function teleport()
player.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(0,50,0))
end
function givetool()
game.ReplicatedStorage.Weapons.ClassicSword:Clone().Parent = player.Backpack
print(player, "has been given a sword")
teleport()
end
button.MouseButton1Click:connect(givetool)
Now, I'm not sure if the script has anything to do with it, but I have no idea what may be causing the issue. Could anybody provide me with some help?

2 comments
Where is this local script located?
The script is located under a button in a GUI that is given to every player: http://imgur.com/nhR3Fx2