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

ServerStorage is not a valid member of DataModel?

Asked by 9 years ago

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)
0
Is this a LocalScript or ServerSide script? Btw, you never defined player. M39a9am3R 3210 — 9y
0
My bad, its suppose to be local player = game.Players.LocalPlayer.Character and this is a LocalScript. UnleashedGamers 257 — 9y
0
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. M39a9am3R 3210 — 9y
0
I got a new error in the developer output : attempt to index upvalue 'player' a nil value UnleashedGamers 257 — 9y
0
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 Redbullusa 1580 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

local serverstorage = game:GetService("ServerStorage")

Ad

Answer this question