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

Why doesn't this GUI show up when I'm ingame, but will show up in Studio?

Asked by 6 years ago

I am trying to make this intro thing, it'll work when you do it in studio but will do nothing afterwards, could anyone help?

game.Workspace.Intro.Playing = true
wait(34)
game.Workspace.Intro.Playing = false
--Script dies here
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Visible = false
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.ImageLabel.Visible = false
wait(.00000000000000000000000000001)
--I don't know why I have a wait here to be honest.
workspace.Water.Playing = true
workspace.Music.Playing = true
game.Players.LocalPlayer.PlayerGui.ScreenGui2.ImageLabel.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui2.Console.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui2.Load.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui2.Settings.Visible = true

I am kind of bad at scripting, so if you could go easy on me that'd be great. Thanks if you can help!

0
If this is a serverscript please hanger it to a localscript. MachoPiggies 526 — 6y
0
Cause you are using game.Players.LocalPlayer when the player hasnt even loaded yet greatneil80 2647 — 6y
0
I've put it in a local script before and it hasn't worked. The music doesn't even start. CaptainAlien132 225 — 6y

1 answer

Log in to vote
0
Answered by
Robin5D 186
6 years ago
Edited 6 years ago
game.Workspace.Intro.Playing = true
wait(34) 
game.Workspace.Intro.Playing = false
--Script dies here
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Visible = false
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.ImageLabel.Visible = false
wait(.00000000000000000000000000001)
--I don't know why I have a wait here to be honest.
workspace.Water.Playing = true
workspace.Music.Playing = true
game.Players.LocalPlayer.PlayerGui.ScreenGui2.ImageLabel.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui2.Console.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui2.Load.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui2.Settings.Visible = true

Okay, this is the code snippet you posted. I can see some improvements that can be made here:

game.Workspace.Intro:Play()
wait(34) -- if you could comment why this is here, please do. if you're waiting till the end of the sound, do wait(game.Workspace.Intro.TimeLength) instead
game.Workspace.Intro:Stop()
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Visible = false
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.ImageLabel.Visible = false
wait() -- to wait the smallest time possible, remove all args from wait(). probably should remove this though as it servers no purpose
workspace.Water:Play()
workspace.Music.Playing:Play()
game.Players.LocalPlayer.PlayerGui.ScreenGui2.ImageLabel.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui2.Console.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui2.Load.Visible = true
game.Players.LocalPlayer.PlayerGui.ScreenGui2.Settings.Visible = true

next, put this into a localscript. the sound probably wont play: a way you can fix this is adding the sounds to StarterGUI instead.

ALWAYS USE Sound:Play() INSTEAD OF .Playing = true

0
Also, I sugguest you read up on the ROBLOX wiki page: http://wiki.roblox.com/index.php?title=API:Class/Sound for sound. ROBLOX wiki has saved me so many times it's unbelievable. Robin5D 186 — 6y
Ad

Answer this question