StarterGUI Isn't Working

Hello! So Basically I’m trying to make a rhythm game, yes, a rhythm game, I don’t have much scripting nolage I think I’m Novice, anyway, I’m trying to make it so when the player picks TestSong then, the 3, 2, 1, Go! UI Will pop Up, the Issue is, nothing is happening and their are no errors :expressionless:

The Script

local MarioPaintBGM1Music = game.ServerStorage["Mario Paint - BGM 1"]
local MarioPaintTimeRegressionueotanremix = game.ServerStorage["Mario Paint ( Time Regression Mix ) - ueotan"]
local TestSongButton = game.StarterGui.SongsGUI.Frame.TestSongButton
local Three = game.StarterGui.CountdownGui.ThreeImageLabel
local Two = game.StarterGui.CountdownGui.TwoImageLabel
local One = game.StarterGui.CountdownGui.OneImageLabel
local Go = game.StarterGui.CountdownGui.GoImageLabel

TestSongButton.MouseButton1Click:Connect(function()
	TestSongButton.Parent.Visible = false
	wait(5)
	Three.Visible = true
	wait(0.5)
	Three.Visible = false
	Two.Visible = true
	wait(0.5)
	Two.Visible = false
	One.Visible = true
	wait(0.5)
	One.Visible = false
	Go.Visible = true
	wait(0.5)
	Go.Visible = false
end)

That’s because you’re trying to use game.StarterGui

use

game.Players.LocalPlayer:WaitForChild("PlayerGui") 

instead

(It’s where the GUIs on your screen while playing was located)

1 Like
  21:32:35.057  ServerScriptService.SongHandler:8: attempt to index nil with 'WaitForChild'  -  Server - SongHandler:8
  21:32:35.061  Stack Begin  -  Studio
  21:32:35.061  Script 'ServerScriptService.SongHandler', Line 8  -  Studio - SongHandler:8
  21:32:35.061  Stack End  -  Studio

What I changed,

local MarioPaintBGM1Music = game.ServerStorage["Mario Paint - BGM 1"]
local MarioPaintTimeRegressionueotanremix = game.ServerStorage["Mario Paint ( Time Regression Mix ) - ueotan"]
local TestSongButton = game.StarterGui.SongsGUI.Frame.TestSongButton
local Three = game.StarterGui.CountdownGui.ThreeImageLabel
local Two = game.StarterGui.CountdownGui.TwoImageLabel
local One = game.StarterGui.CountdownGui.OneImageLabel
local Go = game.StarterGui.CountdownGui.GoImageLabel
game.Players.LocalPlayer:WaitForChild("PlayerGui")

TestSongButton.MouseButton1Click:Connect(function()
	TestSongButton.Parent.Visible = false
	wait(5)
	Three.Visible = true
	wait(0.5)
	Three.Visible = false
	Two.Visible = true
	wait(0.5)
	Two.Visible = false
	One.Visible = true
	wait(0.5)
	One.Visible = false
	Go.Visible = true
	wait(0.5)
	Go.Visible = false
end)

not like that

do:

local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local Three = PlayerGui.CountdownGui.ThreeImageLabel

(and yes it has to be a LocalScript)

1 Like

It has to be a localscript for it to work or use RemoteEvents to a localscript.

Its because u did game.StarterGui you need to do game.FindFirstChild(“StarterGui”)

Also, you cannot access ServerStorage or ServerScriptService from a localscript.

That won’t work since StarterGui does not update all the player’s gui also it would be game:GetService() if that was the case.

I put it in ReplicatedStorage or Workspace

since server-sided scripts can access ServerScriptStorage or ServerStorage

Workspace won’t work since localscripts don’t run there.

I meant audios not LocalScripts

Oh yeah sorry i mixed up i wanted to write getservice but i wrote findfirstchild by accident

When I put it inside of Workspace It didn’t work, Im trying out ReplicatedStorage

Make sure it’s a local script cause it won’t work if not.

Yeah, because LocalPlayer doesn’t work for server-sided scripts

1 Like

I alr made sure it was.


I think he meant he put the script there.

This is offtopic and kinda random, its not related to the post

Well, I meant I put audios in Workspace or ReplicatedStorage

and you said when you put it in Workspace it doesn’t work

I’ll stop asking this

I meant the LocalScript, not anything about audios