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

My TextLabel script works in Studio but not in a server?

for _,v in pairs(game.Players:GetChildren()) do
	v.PlayerGui:WaitForChild("ScreenGuiA")
   	v.PlayerGui.ScreenGuiA.TextLabel.Text = "You need 1 more player for this to start."
end

This is the part of the script that it directs me to when I open up developer console. Is there something I'm doing wrong?

Additional information:

  • It's in a ServerScript in ServerScriptService.

2 comments

0

Is this for EveryPlayer

0

Also Forgot to Mention Make the Script in Workspace ServerScripts dont work in serverscriptservice

1 answer

If it is for ever player to see Add a String Value in ReplicatedStorage and name it Status

Now put this in the Text

local Status = game.ReplicatedStorage:WaitForChild("Status") --Finding the Value

script.Parent.Text = ""..Status.Value.."'"
status.Changed:Connect(function()
	script.Parent.Text = ""..Status.Value.."'"
end)

Now to Change the Status do another Script

local Players = game:GetService("Players")
local Status = game.ReplicatedStorage:WaitForChild("Status") 

function onPlayerAdded(player) --When a player joins

Status.Value = "A Player Has Joined!" --Enters the Text
wait(5)
Status.Value = " " --Clears the Text
end

Now you can edit it to find the amount of players This will just Change the Text when a player enters the game

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