Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

twitter code help?

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

0

Is FilteringEnabled turned on?

0

what does hat do?

0

that just made all my open scripts not work :(

0

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)

0

I can help you if you tell me how your GUI is laid out. Example: ScreenGui>Frame>TextButton>TextBox.

2

Is this a LocalScript?

0

no

1 answer

✓ Accepted answer

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.

1 comment

0

okay

This discussion is preserved as it was. New answers, comments, and votes are closed.