I have made a round system and a main menu gui. The round system is fine except I cant figure out a way to send the player back to the main menu gui along with the lobby that players spawn in before being teleported to the map. Any help is appreciated!
Script:
local Status = game.ReplicatedStorage.Status
local LobbySpawn = game.Workspace.Spawns.HumanSpawn
local GameSpawn = game.Workspace.Spawns.HumanTP
InRound.Changed:Connect(function()
wait(1)
if InRound.Value == true then
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = GameSpawn.CFrame
end
else
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = LobbySpawn.CFrame
if player.Action.died then
char.HumanoidRootPart.CFrame = GameSpawn.CFrame
end
end
end
end)
local function roundTimer()
while wait() do
for i = intermissionlength, 0, -1 do
InRound.Value = false
wait(1)
Status.Value = "TIME: ".. i ..""
end
for i = roundlength, 0, -1 do
InRound.Value = true
wait (1)
Status.Value = "TIME: ".. i ..""
end
end
end
spawn{roundTimer()}
Before we go any further, please remove the previous unformatted question (meaning the one that didn’t have formatted code) to allow more clarity.
Also I do not believe that is how you use spawn:
spawn(function()
--Do whatever here
end)
--or in your case
spawn(roundTimer)
You are using the brackets used for tables instead, which is wrong. Use “()” instead of “{}” in the future.
Thanks for the advice but is there a way around the main menu issue? Its the main issue Im having
You could fire a remote event to the client to prompt the UI to become enabled again, unless I’m misunderstanding stuff.
as @reallyjustjeff said, u can fire a remote event to the server and enable the gui or duplicate it and put it to the playergui after the round is finished… also, if ur making it so the players go back then just teleport the players to the spawn location or just kill them (i just make a spawn tp part and tp them there to the part)
Thanks guys! I will try that now
however I am not too good when it comes to scripting
the script doesnt work, Ive tried with lots of edits but cant get it working
Post it here so it can be debugged, I am guessing you haven’t got a lot of experience with remote event usage
Do you mean the script? Or something else?
The script you said you made edits to.
Ill try my best to help even though wont be that active…
Go show ur script so we can help you easier lol