|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 25 Aug 2016 04:58 AM |
Any errors in the output window?
-The [Guy] |
|
|
| Report Abuse |
|
|
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 |
|
|