Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

teleport script

Asked by 11 years ago

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!

01function Clicked()
02------------------------------------
03modelname="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)
View all 48 lines...

1 answer

Log in to vote
2
Answered by
Teeter11 281 Moderation Voter
11 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

In a gui put this in a localscript :)

1player = game.Players.LocalPlayer
2script.Parent.MouseButton1Down: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
8end)
0
nope chabad360 34 — 11y
0
That would work i also think you misspelled atmosphere Teeter11 281 — 11y
0
the prob is not spelling. i couldnt telaport are you sure is a localscript? chabad360 34 — 11y
0
You may need to change the teleport part to fit all your words Teeter11 281 — 11y
View all comments (3 more)
0
the spelling in the way it is but it should still go to the block chabad360 34 — 11y
0
sheesh you spelled it one way me the other and poof it dont work! chabad360 34 — 11y
0
did u put it in a localscript Teeter11 281 — 11y
Ad

Answer this question