Hi I have scripted this code for my game. This is a twitter code thingy. When I enter the twitter code it says "code accepted" then it gives me the item (That's in roblox studio testing). But when save it to my place and play my game, and enter the code it says "Code accepted" but it does not give me the item! Can you help please?
`local plr = game.Players.LocalPlayer local box = script.Parent.Parent.Enter function onClick() if box.Text == "TEST" then box.Text = "Code accepted" wait(2) box.Text = "Enter Code" local a = game.ReplicatedStorage.Sword:Clone() a.Parent = plr.Backpack else box.Text = "Invalid code" wait(2) box.Text = "Enter Code" end end script.Parent.MouseButton1Down:connect(onClick)`
The problem is it isn't a localscript. In order to access local player the script needs to be a localcript. All you have to do is change the script into a localscript, same code.