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

ServerScriptService Is Not A Valid Member Of DataModel ?

I Have Been Losing My Sanity And The Will To Continue Coding Even Though It Is The Most Favourite Activity For Me To Do In The Meantime.

It Works Swiftly In Studio Mode But Not In Game

"ServerScriptService Is Not A Valid Member Of DataModel Stack Begin Script' Players.GizmoProductions.PlayerScripts.ModePickToText ', Line 6 Stack End"

Main = script.Parent.Parent

game.Workspace.NumberPlayers.Changed:connect(function()
	wait(0.5)
	if game.Workspace.NumberPlayers.Value >= 1 then
		game.ServerScriptService.ModePicker.Disabled = false
		game.SoundService.DrumRoll:Play() Main.PlayerGui.ModePickGUI.RoundShadow:TweenPosition(UDim2.new(0.314,0,
0.343,0)) 
		wait(5)
		local Rand = game.Workspace.Mode.Value
		Main.PlayerGui.ModePickGUI.RoundShadow.DropShadow.Namez.Text = Rand
	end
end)

1 answer

✓ Accepted answer

ServerScriptService is a service so you have to use :GetService() method to access it.

In our case just replace game.ServerScriptService with game:GetService("ServerScriptService")

2 comments

0

g1o2 thanks it really helped me, sorry you think that i never appreciated your work i was after doing it after i sent in that complaint you saw

0

it's ok, it's just that it's always good to have feedback, even for people who answer the questions. Anyways enjoy your scripting :)

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