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: Help

Previous Thread :: Next Thread 
SixGamesINC is not online. SixGamesINC
Joined: 15 Aug 2016
Total Posts: 8
25 Aug 2016 02:33 AM
I am trying to get my Gui Teleport button to close after clicking i looked up on YouTube and had no luck besides ones for intros and it still wasn't working does anyone know any scripts that will close it after clicked? here is what the script looks like so far:

local plr = game.Players.LocalPlayer
local tpPart = workspace:WaitForChild('TeleportPart')

script.Parent.MouseButton1Click:connect(function()
local torso = plr.Character:WaitForChild('Torso')
torso.CFrame = tpPart.CFrame
end)
Report Abuse
SixGamesINC is not online. SixGamesINC
Joined: 15 Aug 2016
Total Posts: 8
25 Aug 2016 02:39 AM
i want it to stay closed after they click until they die so people cant spam it and get away from pvp and stuff
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
25 Aug 2016 03:31 AM
local plr = game.Players.LocalPlayer
local tpPart = workspace:WaitForChild('TeleportPart')

script.Parent.MouseButton1Click:connect(function()
local torso = plr.Character:WaitForChild('Torso')
torso.CFrame = tpPart.CFrame
script.Parent.Visible = false
end)


All I added was
script.Parent.Visible = false
to make it disappear after they click it.
-The [Guy]
Report Abuse
SixGamesINC is not online. SixGamesINC
Joined: 15 Aug 2016
Total Posts: 8
25 Aug 2016 03:39 AM
that worked but when i reset my character and click it again it doesnt work anyway to fix it?
Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
25 Aug 2016 04:58 AM
Any errors in the output window?

-The [Guy]
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
25 Aug 2016 06:10 AM
local plr = game.Players.LocalPlayer
local tpPart = workspace:WaitForChild('TeleportPart')

game:GetService('Players').PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
script.Parent.Visible = true
end)
end)
end)


script.Parent.MouseButton1Click:connect(function()
local torso = plr.Character:WaitForChild('Torso')
torso.CFrame = tpPart.CFrame
script.Parent.Visible = false
end)


- 𝑱𝒐𝒔𝒉𝑹𝑩𝑿 -
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