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

How do I make so this surface gui works in game and not only in studio?

I'm trying to script a computer with Surface Guis, all seems fine on studio, but when I play the game it won't work. For example, there's a On/Off button that works with a Click Detector and make the computer show a "Initializing" screen, but when I play the game it does not work. Here's part of the script:

game.Players.PlayerAdded:Connect(function(plr)
	pcbutton.ClickDetector.MouseClick:connect(function()
		if energyon == true and pcon == false then
			pcbutton.Click:Play()
			comp.Tela.Color = Color3.fromRGB(70,70,70)
			game:GetService("Workspace").Computador.Tela.Reflectance = 0
			pcon = true
			pcbutton.BrickColor = BrickColor.new("Lime green")
			pcbutton.Material = Enum.Material.Neon
			pcbutton.ClickDetector:Destroy()
			local initializer =	game:GetService("Workspace").Computador.Tela.Initializing
			initializer.Enabled = true
			
			
			for i=0, 3 do
				initializer.TextLabel.Text = "Initializing PC."
				wait (0.8)
				initializer.TextLabel.Text = "Initializing PC.."
				wait(0.8)
				initializer.TextLabel.Text = "Initializing PC..."
				wait(0.8)
			end

*This is a Global Script.

2 comments

0

for i=0, 3 do Would loop infinitely

0

Why would it loop infinitely?

1 answer

Might be this: ~~~~~~~~~~~~~~~~~ game.Players.PlayerAdded:Connect(function(plr) pcbutton.ClickDetector.MouseClick:connect(function()


Try clicking whatever you need to click

2 comments

0

What did you change?

0

Umm nothing, you need to click the pcbutton

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