|
| 30 Nov 2016 07:13 PM |
Hey, so I'm trying to figure out when I step on this brick, it gives me a GUI, and inside this GUI has a button that can teleport me to a certain place on the map. It doesn't seem to work, and I'm pretty frustrated lol, if anyone can help that would be awesome!
~~~~~~~~~~~~~~~~~ local plr = game.Players.LocalPlayer local pos1 = game.pos1
function Click() script.Parent.Parent.Parent.Parent = pos1 --This is probably totally wrong but if they click on it, they get teleported lol. end
if Click() then plr.ScreenGUI:remove() -- idk if this is right but if they click on it, it removes the GUI. end
script.Parent.MouseButton1Down:connect(Click)
~~~~~~~~~~~~~~~~~
--BELOW IS WHEN THEY STEP ON THE PART THE GAME INSERTS THE GUI.
~~~~~~~~~~~~~~~~~
local debounce = false
function getPlayer(humanoid) local players = game.Players:children() for i = 1, #players do if players[i].Character.Humanoid == humanoid then return players[i] end end return nil end
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid") if (human ~= nil) and debounce == false then
debounce = true
local player = getPlayer(human)
if (player == nil) then return end
script.Parent:clone().Parent = player.PlayerGui
wait(2) debounce = false end end
script.Parent.Parent.Touched:connect(onTouch)
--This whole script is inserted into the ScreenGUI. ~~~~~~~~~~~~~~~~~
I'm not a great scripter but hopefully I can learn from all of you! (:
Thanks, LukeGabrieI |
|
|
| Report Abuse |
|
|
XCVlll
|
  |
| Joined: 23 Oct 2008 |
| Total Posts: 963 |
|
|
| 30 Nov 2016 07:35 PM |
| the whole entire first part just makes no sense |
|
|
| Report Abuse |
|
|
Cubloxia
|
  |
| Joined: 24 Nov 2015 |
| Total Posts: 11 |
|
|
| 01 Dec 2016 12:11 AM |
Make a script in the brick that opens the GUI, and in that GUI, create a text button that makes people teleport to a certain place in the game. If you need an example pm me.
|
|
|
| Report Abuse |
|
|
Revelted
|
  |
| Joined: 02 Nov 2014 |
| Total Posts: 503 |
|
|
| 01 Dec 2016 12:16 AM |
| Why cant you have the teleport GUI in lighting, and when a player steps on the brick, the gui is cloned into starter gui? |
|
|
| Report Abuse |
|
|
tbnj123
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 443 |
|
| |
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 01 Dec 2016 03:46 AM |
| http://wiki.roblox.com/index.php?title=Teleportation |
|
|
| Report Abuse |
|
|
|
| 01 Dec 2016 08:20 AM |
local part=game.Workspace.Part1 -- the part you want to teleport the player to teleport to local d=true -- debounce script.Parent.Touched:connect(function(limb) if game:GetService("Players"):FindFirstChild(limb.Parent.Name) then if d==true then d=false local plr=game:GetService("Players"):GetPlayerFromCharacter(limb.Parent) local gui=Instance.new("ScreenGui",plr.PlayerGui) local button=Instance.new("TextButton",gui) button.Size=UDim2.new(0,200,0,50) button.MouseButton1Down:connect(function() plr.Character.Torso.CFrame=part.CFrame+Vector3.new(0,2,0) gui:remove'' d=true end) end else return end end)
found it lol |
|
|
| Report Abuse |
|
|