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
 

Step on Part, Teleport to Part GUI?

Previous Thread :: Next Thread 
LukeGabrieI is not online. LukeGabrieI
Joined: 27 Dec 2012
Total Posts: 87
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 is not online. 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 is not online. 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 is not online. 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 is online. tbnj123
Joined: 29 Oct 2010
Total Posts: 443
01 Dec 2016 01:10 AM
u lost me at game.pos1
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
01 Dec 2016 03:46 AM
http://wiki.roblox.com/index.php?title=Teleportation
Report Abuse
LukeGabrieI is not online. LukeGabrieI
Joined: 27 Dec 2012
Total Posts: 87
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
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