Any idea how to fix this?

Hi. I’ve written a simple script and for some reason it only works when you run it - it doesn’t work when there is a player in the server. As I’m quite new to lua, I have no idea on how to fix it and would appreciate if someone could help.

Here’s the script:

local starter = gui.StarterScreen
local secondary = gui.SecondaryScreen.RequirementText.RuleText
local secT = secondary.Title
local secR = secondary.Reqs

local startI = starter.Images
local startT = starter.Text

local waitI = game:GetService("StarterGui").ScreenGui.wait

local waiting = {"PLEASE WAIT.","PLEASE WAIT..","PLEASE WAIT...","hi","hiw","hi"}



for i, v in pairs(waiting) do
	wait(1)
	waitI.Text = "PLEASE WAIT."
	wait(1)
	waitI.Text = "PLEASE WAIT.."
	wait(1)
	waitI.Text = "PLEASE WAIT..."
	
end

print("hi")

waitI.Text = "APPLICATION LOADED"
wait(3)

gui.StarterScreen:Destroy()
waitI:Destroy()
wait(1)
secondary.Title.b.Visible = true
wait(1)
secondary.Title.a.Visible = true
wait(3)
secondary.a.Visible = true
secondary.b.Visible = true
wait(2)
secondary.Title.a.Visible = true
wait(1)
secondary.Title.b.Visible = true
wait(4)
secondary.Reqs.bc.Visible = true
wait(3)
secondary.Reqs.CRIM.Visible = true
wait(3)
secondary.Reqs["13"].Visible = true
wait(3)
secondary.Reqs.sc.Visible = true
wait(3)
secondary.Reqs["50"].Visible = true

wait(3)
gui.SecondaryScreen:Destroy()

local phase = gui.PhasesScreen
local title = phase.Title
local phaseA = phase.Phases

title.b.Visible = true
wait(2)
title.a.Visible = true
wait(2)
phaseA.phaseA.Visible = true
wait(1)
phaseA.phaseB.Visible = true
wait(1)
phaseA.phaseC.Visible = true
wait(1)
phaseA.phaseAinfo.Visible = true
wait(4)

phase:Destroy()
wait(1)
game:GetService("StarterGui").ScreenGui:Destroy()```

Does it give any errors in the Dev Console?

Nothing shows up in the dev console.

Is this a local script or a regular script? I think it might be that this is running on the server and not the client.

It needs to be a localscript if it’s not, and you’ll have to change all the StarterGuis to the player’s PlayerGui

Yes, it’s a local script, no idea why it isn’t working.

your “waitI” gui is referencing the starter gui folder, It should be referencing the player’s gui.

local waitI = game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui.wait

Something like that should work. (I’m not sure if this is the problem your talking about though, are the gui’s showing up at all? or is just blank on the player’s screen?).

The GUI appears, but none of the other scripts works, for example, the text doesn’t change. I replaced the waitI variable with yours but it still doesn’t work.

My bad!

local waitI = game:GetService("Players").LocalPlayer.PlayerGui:WaitForChild("ScreenGui").wait

Sorry for the response time, I’m in-between threads right now.

Edit: I would do this to the rest of your Gui’s. They’re not changing for the player since your currently changing the Gui in StarterGui, which is copied to each player when they join. This is why it isn’t changing for each player individually.

Here is a helpful link:

(I haven’t read the whole thing, it is a bit of a read, but it explains the difference between startergui and playergui).