generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Need help about timers and guis

Previous Thread :: Next Thread 
kii55_ALT is not online. kii55_ALT
Joined: 13 Nov 2016
Total Posts: 67
15 Jul 2017 05:54 PM
I still havent figuired this out because im dumb but how do you make a gui appear on the screen when a timer finishes?
Report Abuse
Noxility is online. Noxility
Joined: 04 May 2016
Total Posts: 111
15 Jul 2017 05:58 PM
function starttimer()
wait(5)
game.Players.LocalPlayer.PlayerGui.UIName:Destroy()

end

script.Parent.MouseButton1Click:connect(starttimer)
Report Abuse
Noxility is online. Noxility
Joined: 04 May 2016
Total Posts: 111
15 Jul 2017 05:58 PM
You'd want to make that a local script and put it in a textbutton.
Report Abuse
kii55_ALT is not online. kii55_ALT
Joined: 13 Nov 2016
Total Posts: 67
15 Jul 2017 06:00 PM
Uhh... Why is mousebutton1click in there? I meant when a timer finished a gui would pop up on your screen
Report Abuse
Niveum is not online. Niveum
Joined: 15 Aug 2009
Total Posts: 3437
15 Jul 2017 06:54 PM
local timer_time = 5

wait(timer_time)
local gui = Instance.new("ScreenGui",parent)
local tl = Instance.new("TextLabel")
tl.Text = "Times up"


you could also use delay if you want other code to run as well

delay(timer_time, function()
-- code from above
end)

But if your going to be creating a screengui, youll need to run it as a local script in the player/place that local scripts run because server scripts cant access the playergui


~ S P I C Y ~
Report Abuse
Noxility is online. Noxility
Joined: 04 May 2016
Total Posts: 111
15 Jul 2017 08:55 PM
Yeah, use that person's. LOL
Report Abuse
kii55_ALT is not online. kii55_ALT
Joined: 13 Nov 2016
Total Posts: 67
15 Jul 2017 09:04 PM
Also could i make it so it waits till there are 2 players in the game then run the timer script?
Report Abuse
Niveum is not online. Niveum
Joined: 15 Aug 2009
Total Posts: 3437
15 Jul 2017 09:10 PM
local can_run = true

game.Players.PlayerAdded:connect(function()
if #(game.Players:GetPlayers()) >= 2 and can_run == true then
can_run = false
-- code
end
end)


take out the can_run stuff if you want it to run more than once, every time 2 or more players are added, change >= to == if you want it to only run when exactly 2 players are present


~ S P I C Y ~
Report Abuse
kii55_ALT is not online. kii55_ALT
Joined: 13 Nov 2016
Total Posts: 67
15 Jul 2017 09:43 PM
Thanks Niveum, your a big help.
Report Abuse
kii55_ALT is not online. kii55_ALT
Joined: 13 Nov 2016
Total Posts: 67
15 Jul 2017 10:21 PM
Oh and now ive ran into another problem

player.PlayerGui.ScreenGui1.Enabled = true

its in a local script and it doesnt make screengui1 enabled...
Report Abuse
kii55_ALT is not online. kii55_ALT
Joined: 13 Nov 2016
Total Posts: 67
15 Jul 2017 10:37 PM
BuMp
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image