How do I make a screen GUI that goes 12pm 1am 2am 3am 4am 5am 6am and then teleports you to another game? I want to know because I am making a Five Nights At Freddy's game.
COMMUNITY QUESTION
How do I make a screen GUI timer from 12pm to 6am for a FNAF game?
1 answer
First we must get the variables
local TimeGUI = script.parent -- Or whereever it is
local waitTime = 5 -- Or how long between each hour
local TeleportService = game:GetService("TeleportService")
Then we add a function
game.Players.PlayerAdded:Connect(function(plr)
end)
Next, we must make the waits
game.Players.PlayerAdded:Connect(function(plr)
wait(waitTime)
wait(waitTime)
wait(waitTime)
wait(waitTime)
wait(waitTime)
wait(waitTime)
end)
In between those we change the text
game.Players.PlayerAdded:Connect(function(plr)
TimeGui.Text = "12pm"
wait(waitTime)
TimeGui.Text = "1am"
wait(waitTime)
TimeGui.Text = "2am"
wait(waitTime)
TimeGui.Text = "3am"
wait(waitTime)
TimeGui.Text = "4am"
wait(waitTime)
TimeGui.Text = "5am"
wait(waitTime)
TimeGui.Text = "6am"
end)
Now we must teleport (taken straight from the roblox wiki)
game.Players.PlayerAdded:Connect(function(plr)
local yourplace = 123456789 -- ID of your game
local destination = 408502380 -- ID of the game you want to be sent to
TimeGui.Text = "12pm"
wait(waitTime)
TimeGui.Text = "1am"
wait(waitTime)
TimeGui.Text = "2am"
wait(waitTime)
TimeGui.Text = "3am"
wait(waitTime)
TimeGui.Text = "4am"
wait(waitTime)
TimeGui.Text = "5am"
wait(waitTime)
TimeGui.Text = "6am"
TeleportService:Teleport(destination, player)
end)
With that all combined we have this!
local TimeGUI = script.parent -- Or whereever it is
local waitTime = 5 -- Or how long between each hour
local TeleportService = game:GetService("TeleportService")
game.Players.PlayerAdded:Connect(function(plr)
local destination = 123456789 -- ID of the game you want to be sent to
local yourplace = 987654321 -- ID of your game
TimeGui.Text = "12pm"
wait(waitTime)
TimeGui.Text = "1am"
wait(waitTime)
TimeGui.Text = "2am"
wait(waitTime)
TimeGui.Text = "3am"
wait(waitTime)
TimeGui.Text = "4am"
wait(waitTime)
TimeGui.Text = "5am"
wait(waitTime)
TimeGui.Text = "6am"
TeleportService:Teleport(destination, player)
end)
3 comments
0
Not a efficient way to do this.
0
THX SO MUCH!!! Do u know were too put the script?
0
I tired to put it in a gui and stuff but it didn't work can someone explain to me what to do with the script?
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
i hate fnaf but ik a bit how i can help. just make block after place on it surface gui after place in surface gui a text label and write 12pm and you need script that idk how make
thx
i need a script still tho
what do you mean???