I am trying to make a script that gives a weapon only to me. It only hands me a weapon to a player that has my name. Here is the script:
function Added(plr) wait(1) if plr.Name == "EliteRayGawnX2" then local Katana = script.Katana local KatanaClone = Katana:Clone() KatanaClone.Parent = plr.Backpack end end game.Players.PlayerAdded:connect(Added)
It works as intended in studio tests. The weapon but when i actually go to play the game, it does not work. Is it a problem in the script? Or with Roblox?
Put Katana in Lighting and put script in ServerScriptService:
game.Players.PlayerAdded:Connect(function(plr) if plr.Name == "EliteRayGawnX2" then local katana = game.Lighting.Katana katana:Clone().Parent = plr.BackPack end end