I have a teleport script on a textbutton gui and I am using it as part of a school project. and I need to turn it in soon! Can someone please fix the script!
01 | function Clicked() |
02 | ------------------------------------ |
03 | modelname = "atmospheare" |
04 | ------------------------------------ |
05 |
06 | if part.Parent ~ = nil then |
07 | local h = part.Parent:findFirstChild( "Humanoid" ) |
08 | if h~ = nil then |
09 | local teleportfrom = script.Parent.Enabled.Value |
10 | if teleportfrom~ = 0 then |
11 | if h = = humanoid then |
12 | return |
13 | end |
14 | local tele = script.Parent.Parent.Parent.Parent.Parent:findFirstChild( "Workspace" ) |
15 | local teleportto = tele:findfirstchild(modelname) |
In a gui put this in a localscript :)
1 | player = game.Players.LocalPlayer |
2 | script.Parent.MouseButton 1 Down:connect( function () |
3 | if game.Workspace.atmosphere ~ = nil then --just how you want it |
4 | player.Character.Torso.CFrame = CFrame.new( game.Workspace.atmosphere.CFrame.x,game.Workspace.atmosphere.CFrame.y+ 3 ,game.Workspace.atmosphere.CFrame.z) |
5 |
6 | --add any other code here |
7 | end |
8 | end ) |