Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

twitter code help?

Asked by 9 years ago

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)`
0
Is FilteringEnabled turned on? adark 5487 — 9y
0
what does hat do? docrobloxman52 407 — 9y
0
that just made all my open scripts not work :( docrobloxman52 407 — 9y
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) alphawolvess 1784 — 9y
View all comments (3 more)
0
I can help you if you tell me how your GUI is laid out. Example: ScreenGui>Frame>TextButton>TextBox. alphawolvess 1784 — 9y
2
Is this a LocalScript? Perci1 4988 — 9y
0
no docrobloxman52 407 — 9y

1 answer

Log in to vote
2
Answered by 9 years ago

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.

0
okay docrobloxman52 407 — 9y
Ad

Answer this question