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)`

7 comments
Is FilteringEnabled turned on?
what does hat do?
that just made all my open scripts not work :(
He was asking if it's on because it will affect how scripts run, prevent exploiters. Read about it if you want more information on FE. (FilteringEnabled)
I can help you if you tell me how your GUI is laid out. Example: ScreenGui>Frame>TextButton>TextBox.
Is this a LocalScript?
no