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: GUI Message on Click

Previous Thread :: Next Thread 
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
07 Feb 2016 05:10 AM
I am wondering if there is a way to make a GUI pop open As a Warning Message When a player clicks a Gui to teleport to another place.



Report Abuse
direMitten is not online. direMitten
Joined: 18 Jun 2015
Total Posts: 1294
07 Feb 2016 05:12 AM
Sure. Use TextButtons or ImageButtons. They both have a MouseButton1Click event. When the player clicks the button, change the Visible property of the warning message to true.
Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
07 Feb 2016 05:14 AM
So like script.Parent.Parent.FRAMENAME.Visible = true?



Report Abuse
direMitten is not online. direMitten
Joined: 18 Jun 2015
Total Posts: 1294
07 Feb 2016 05:16 AM
Exactly
Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
07 Feb 2016 05:17 AM
Thanks dire



Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
07 Feb 2016 05:29 AM
s = game:service("TeleportService")
id = ("177156215") --put the number here

function onClicked()
script.Parent.Parent.OJHWarning.Visible = true
wait(10)
s:Teleport(id)
end

script.Parent.MouseButton1Click:connect(onClicked)


Help



Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
07 Feb 2016 07:36 AM
Bump



Report Abuse
Out0fTime is not online. Out0fTime
Joined: 25 Dec 2015
Total Posts: 13
07 Feb 2016 07:47 AM
What's the problem? ._.
Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
07 Feb 2016 04:18 PM
What im trying to do is make a GUI open when toy click a button too teleport to a Sub universe game Basicly.



Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
08 Feb 2016 03:52 AM
Bump



Report Abuse
mityguy is not online. mityguy
Joined: 07 Jun 2008
Total Posts: 5483
08 Feb 2016 07:45 AM
That code you posted ought to work, whats up? Where does it break?
Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
08 Feb 2016 04:32 PM
All I know is OJH is not a Valid member of Anything



Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
08 Feb 2016 05:16 PM
Bump



Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
09 Feb 2016 03:04 PM
bump2



Report Abuse
MakerModelLua is not online. MakerModelLua
Joined: 24 Feb 2013
Total Posts: 3544
09 Feb 2016 03:16 PM
output pls
Report Abuse
T00NAMI is not online. T00NAMI
Joined: 10 Mar 2013
Total Posts: 211
09 Feb 2016 03:28 PM
Always wait for the frames and stuff to load using :WaitForChild("")
if you try to reference/use it before it is done loading, the script will error.

Try this: (edit where needed)


local frame = script.Parent:WaitForChild("FRAME NAME") -- change to your frame to make visible
local teleportId = 0 -- put id here
local debounce = true -- to prevent players from clicking more than once.

script.Parent.MouseButton1Click:connect(function(click)
if frame and debounce then -- checks if frame exists
debounce = false -- prevents multiple clicking
frame.Visible = true
wait(10)
game:GetService('TeleportService'):Teleport(teleportId, game.Players.LocalPlayer)
end
end)

Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
09 Feb 2016 04:16 PM
@Toon It Disabled my GUI button so It wont go to any other Games.



Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
09 Feb 2016 04:18 PM
Idk if this will help but http://prntscr.com/a176td



Report Abuse
T00NAMI is not online. T00NAMI
Joined: 10 Mar 2013
Total Posts: 211
09 Feb 2016 04:34 PM
Oh then change:

local frame = script.Parent:WaitForChild("FRAME NAME")

to:

local frame = script.Parent.Parent.Parent:WaitForChild("OJHWarning")
Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
10 Feb 2016 05:17 AM
Ok, GUI Opens (Yay) and now... IT dont teleport...



Report Abuse
matt10010010010 is online. matt10010010010
Joined: 21 Apr 2012
Total Posts: 244
11 Feb 2016 01:20 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