Gameplay is the script inside the textlabel, the script is a zombie spawner Why isn't the script not restarting This script is a local script, in a gui:
1 | player.PlayerGui.Wave.TextLabel.GamePlay.Disabled = true |
2 | game.StarterGui.Wave.TextLabel.GamePlay.Disabled = true |
3 | wait( 5 ) |
4 | player.PlayerGui.Wave.TextLabel.GamePlay.Disabled = false |
5 | game.StarterGui.Wave.TextLabel.GamePlay.Disabled = false |
I think I have a solution. I'm not sure if the Disabled method would work how you might want, another way to do this is to put a RemoteEvent ReplicatedStorage, and you'll Fire this to tell the script to spawn or not. Also a quick side note, if the zombie spawner is a server script, It should be in ServerScriptService, since im not sure if the scripts work there, and that might also be a problem. (Correct me if I'm wrong)
Here's what I mean:
Local script, In a gui
1 | local Spawner = game.ReplicatedStorage.Spawn --Put a RemoteEvent ReplicatedStorage |
2 | local Time = 5 --This is how long the zombies will spawn |
3 | --Any other code you want |
4 | Spawner:FireServer(Time) |
Server Script (Script), In ServerScriptService
1 | local Spawner = game.ReplicatedStorage.Spawn |
2 |
3 | Spawner:OnServerEvent(Player, Time) |
4 | local Waiting = 0 |
5 | repeat wait( --The speed of the zombie spawning. You can change this around to get different spawn times and speeds) |
6 | Waiting = Waiting + 1 |
7 | --Spawn a zombie and stuff |
8 | until Waiting > = Time |
9 | end ) |
Going forward, If your creating any parts, using RemoteEvents really helps with communication between client and server. I hope this helps!