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

Is there a way to make a Pause Mechanic?

Asked by
clrik 8
6 years ago

Can you make a pause mechanic? Like once you keypress, a GUI pops up and stops everything from running. Then when you keypress again, it unpauses the game and everything starts running again.

The main thing I need to know is that can you stop all assets on a simple keypress?

0
I might edit this for a few reasons...for most of the professionals to understand what I am trying to go for. Instead of a poor man begging for help. clrik 8 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

You can't. You'd have to freeze the game, like anchor the body parts of ALL characters. So they didn't move.

0
yea clrik 8 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

You can pause the game, technically.

If you want to, you'll have to rewrite all of your code in your game with an if statement determining whether or not the game is paused.

So, to do this, you would write this following piece of code and slip it into whatever needs to be paused.

if workspace.Paused.Value ~= true then
--Your code here
end

To actually pause the game, you'll want to create a textbutton, or image button, whichever one you prefer. After that, you'll want to create a remote event and then a server script, that flips the value in workspace on whenever the aforementioned event is fired.

I can create an example place of this if you'd like to work off of something. :)

0
Please create an example. I am trying to do when keypress, the player stops walking, and all of the enemies are anchored. clrik 8 — 6y

Answer this question