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

How do I make a screen GUI timer from 12pm to 6am for a FNAF game?

Asked by 4 years ago

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.

0
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 MagicPineappleLOLKA -6 — 4y
0
thx DJTwisted_2 0 — 4y
0
i need a script still tho DJTwisted_2 0 — 4y
0
what do you mean??? ImAnonymousBan 24 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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)
0
Not a efficient way to do this. antoniorigo4 117 — 4y
0
THX SO MUCH!!! Do u know were too put the script? DJTwisted_2 0 — 4y
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? DJTwisted_2 0 — 4y
Ad

Answer this question