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

How do I make a script not go until another script is over? (Read desc)

This is for a live event this is the script that needs to happen after another script ends

if game.StarterGui.Countdown.Frame.Visible == false
	
	then
	script.Parent.Visible = true	
		
	end

How would I make it wait for another script called Flip to end?

7 comments

0

You could make the script change a bool value somewhere in the game, and once that value is true, you can have in the other script make it run. You'll need a loop to keep checking the value in the other script though.

0

O-O @DarkDanny04 do u know how to do all of that I am not a master scripter yet.

0

You will have to use PlayerGui instead of StarterGui, nothing will be altered in StarterGui, only the Player's PlayerGui. You could do repeat wait() until game.Players.LocalPlayer.PlayerGui.Countdown.Frame.Visible == false

0

so @Killerbrenden can you write that in my script I have please?? Would I type Repeat wait()?

0

You can also combine what DarkDanny said, use a boolValue inside of the frame, and when the countdown is done set it to true, and in that script you would check if the bool has changed using game.Players.LocalPlayer.PlayerGui.Countdown.Frame.Visible.Changed:Connect(function(property)

0

Is this a LocalScript or ServerScript?

0

Local

2 answers

✓ Accepted answer

Repeat . . . Until . . .

Repeat Until's are really useful when you don't want code running until a certain action has been achieved. Whenever that action has been done, the rest of the code running underneath the reapeat until will run, until then, the repeat loop will just repeat wait(), which will just wait ever 0.03 seconds to run again.

repeat wait() until game.Players.LocalPlayer.PlayerGui.Countdown.Frame.Visible == false

--// Anything after this will run whenever the frame becomes invisible.

print("Hello World!")

Whenever the Frame becomes invisible, it will print Hello World! because the action has been achieved.

Hope this helped! Feel free to select this as an answer if this worked for you!

3 comments

0

THANK YOU I will test this and accept your answer if it works!

0

No problem! Glad to help!

0

O-O It did not work... I think its the gui thats going away! :( Well thank you for trying ill accept still :/

I would Recommend Remote Events. Firstly you need to add a remote event into replicated storage. For example name it "Steve" then put this in the bottom of the script and when it ends this remote will be fired put this

local RS = game:GetService("ReplicatedStorage")
local SteveEvent = RS.Steve
SteveEvent:FireServer(player) -- player is a variable you want to transfer from one script to another

first script

local RS = game:GetService("ReplicatedStorage")
local Steve = RS.Steve
Steve.OnServerEvent:Connect(function(player)
-- rest of code, 

if that doesn't work try this

local RS = game:GetService("ReplicatedStorage")
local Steve = RS.Steve
if Steve.OnServerEvent:Connect(function(player) then
-- rest of code, 
end -- or end)

5 comments

0

Just fyi, you do not need 'player' in FireServer, as it already transfers it automatically... You'd only want 'player' in the OnServerEvent, that is essential. But in the FireServer, its not. https://developer.roblox.com/en-us/api-reference/function/RemoteEvent/FireServer

0

I am so dumb I cant do it I dont understand :( Is there a repeat script I can do? like where it keeps reading the script until it is true?

0

Well it worked for me

0

ik But im stupid I cant make all of that please is there a loop command or repeat command? @FluffySheep46209

0

@JuzeyPlayz you can do repeat wait() until, and then either use a variable to wait until it's true, or until something in your GUI changes

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