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

ServerScriptService Is Not A Valid Member Of DataModel ?

Asked by 5 years ago
Edited 5 years ago

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

Log in to vote
0
Answered by 5 years ago

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")

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 GizmoProductions 61 — 5y
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 :) g1o2r3d4a5n6 350 — 5y
Ad

Answer this question