|
| 23 Apr 2015 09:00 PM |
ServerScriptStorage is not a valid member of DataModel
I did this:
local TextLabel = game.StarterGui.ScreenGui:WaitForChild("TextLabel") local ServerScriptStorage = game:WaitForChild("ServerScriptStorage")
while wait() do if game.Players.NumPlayers < 2 then script.Parent.TextLabel.Text = "Not Enough Players, please invite a friend!" elseif game.Players.NumPlayers >= 2 then for i = 10, 0, -1 do script.Parent.TextLabel.Text = "There are now enough players, server Start-Up in "..i.." Seconds" wait(1) game.ServerScriptService.GameScript.Disabled = false end break end end TextLabel.Visible = false |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
|
| 23 Apr 2015 09:03 PM |
| Still makes no sense if you tell me that. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Apr 2015 09:04 PM |
| It's called ServerScriptService, not ServerScriptStorage. |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Apr 2015 09:06 PM |
local SS = game.ServerScriptService
Just use that. |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 09:09 PM |
| Still saying It's not a valid member of DataModel. |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 09:10 PM |
local TextLabel = game.StarterGui.ScreenGui:WaitForChild("TextLabel") local ServerScriptService = game.ServerScriptService local GS = ServerScriptService:WaitForChild("Game Script")
while wait() do if game.Players.NumPlayers < 2 then script.Parent.TextLabel.Text = "Not Enough Players, please invite a friend!" elseif game.Players.NumPlayers >= 2 then for i = 10, 0, -1 do script.Parent.TextLabel.Text = "There are now enough players, server Start-Up in "..i.." Seconds" wait(1) GS.Disabled = false end break end end |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Apr 2015 09:18 PM |
| Instead of using a localscript, use a server script and iterate through the player's gui's to change the message. |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 09:20 PM |
| So I never needed a local script in the frame? |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 09:22 PM |
| No, you should use a LocalScript, but LocalScripts can't access SERVERStorage and SERVERScriptService. |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 09:23 PM |
| But actually, you should use a Script server-side, and use FireAllClients with a RemoteEvent and have it change the text through that in a LocalScript. |
|
|
| Report Abuse |
|
|
|
| 23 Apr 2015 09:27 PM |
I can't do Events.
They are impossibly hard to me. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Apr 2015 09:27 PM |
No. Just do something like this in a server script.
while wait() do for i,v in pairs(game.Players:GetChildren()) do for i,g in pairs(v.PlayerGui:GetChildren() do if g.Name == "ScreenGui" then if game.Players.NumPlayers < 2 then g.TextLabel.Text = "Not enough Players, please invite a friend!" elseif game.Players.NumPlayers >= 2 then for i = 10,0,-1 do g.TextLabel.Text = "There are now enough players, server Start-Up in" ..i.." Seconds" wait(1) end game.ServerScriptService.GameScript.Disabled = false game.StarterGui.ScreenGui.TextLabel.Visible = false g.TextLabel.Visible = false end end end end end
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 23 Apr 2015 09:30 PM |
| Also add an ")" to line 3. Also, you can add a "repeat wait() until game.ServerStorage.GameScript.Disabled = true for this script to wait until the game is ended for this to start again. |
|
|
| Report Abuse |
|
|