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

How to Pause your script so it dosen't do anything?

So I wanted to pause the script so I made a game which if you press play in the GUI and there is only 1 player on it then I wanted to Pause the script so it doesn't do anything and if there is more than 1 player than we press play and we can start playing. I know how to Disable your script but I want to know another way using Code as I think it is easy for me so I can't add many promotes using the if statement.

1 answer

You can true using a Bool value and in the right conditions, you turn it from true to false. However, you have to but the bool value in your Gui, not ReplicatedStorage, since it won't work if you do.

local RunService = game:GetService("RunService")

local boolValue = script.Parent.BoolValue --Lets assume you put it in the same folder or parent as the script.

RunService.RenderStepped:Connect(function()
	if boolValue.Value then
		--Make your code do stuff
	end
end)

1 comment

2

Why are you using runservice? That is totally unnecessary. RenderStepped is NOT a substitute to while loops.

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