|
| 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 |
|
|
|
| 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 |
|
|
|
| 07 Feb 2016 05:14 AM |
So like script.Parent.Parent.FRAMENAME.Visible = true?
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 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 |
|
|
| |
|
Out0fTime
|
  |
| Joined: 25 Dec 2015 |
| Total Posts: 13 |
|
| |
|
|
| 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 |
|
|
| |
|
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 |
|
|
|
| 08 Feb 2016 04:32 PM |
All I know is OJH is not a Valid member of Anything
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
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 |
|
|
|
| 09 Feb 2016 04:16 PM |
@Toon It Disabled my GUI button so It wont go to any other Games.
|
|
|
| Report Abuse |
|
|
|
| 09 Feb 2016 04:18 PM |
Idk if this will help but http://prntscr.com/a176td
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 10 Feb 2016 05:17 AM |
Ok, GUI Opens (Yay) and now... IT dont teleport...
|
|
|
| Report Abuse |
|
|
| |
|