Why do I keep getting the error named in the title?
local box = script.Parent.TwitterCode
local player =
function onClick()
if box.Text == "OP3NING" then
wait(1)
box.Text = "Valid!"
local s = game.ServerStorage.Sparkles:Clone()
s.Parent = player.Torso
wait(3)
box.Text = "Twitter Code"
else
box.Text = "Invalid!"
wait(3)
box.Text = "Twitter Code"
end
end
script.Parent.MouseButton1Click:connect(onClick)

5 comments
Is this a LocalScript or ServerSide script? Btw, you never defined player.
My bad, its suppose to be local player = game.Players.LocalPlayer.Character and this is a LocalScript.
That's your problem. ServerStorage is not replicated to the Clients, therefore a LocalScript would not help. Might I suggest moving the object to ReplicatedStorage, it is basically server storage but for the client usage.
I got a new error in the developer output : attempt to index upvalue 'player' a nil value
Hopefully it's because the local script ran so fast that the Character was still nil when it was executed. Replace "local player = game.Players.LocalPlayer.Character" with http://hastebin.com/gixavalowa.vhdl