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

ServerStorage is not a valid member of DataModel?

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

0

Is this a LocalScript or ServerSide script? Btw, you never defined player.

0

My bad, its suppose to be local player = game.Players.LocalPlayer.Character and this is a LocalScript.

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.

0

I got a new error in the developer output : attempt to index upvalue 'player' a nil value

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

1 answer

local serverstorage = game:GetService("ServerStorage")

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