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

Sorry if I already said this but, How do you teleport?

Asked by
mnaj22 44
10 years ago

What I tried...

Player = game.Players.LocalPlayer if script.Parent.Parent.Name ~= "GO!" or "Waiting.." then script.Disabled = true else script.Disabled = false end

function onTouch() Player.Character.Torso.CFrame = CFrame.new(-29.799, 4, 109.567) Player.Character.Humanoid.WalkSpeed = 0 wait(10) Player.Character.Humanoid.WalkSpeed = 16 end

script.Parent.Touched:connect(onTouch)

I did this in a Local Script

0
Your code would be much more readable if you only had one statement per line, and also remember to use the Lua code formatting to make it more readable on here! BlueTaslem 18071 — 10y

6 answers

Log in to vote
0
Answered by 10 years ago

Are you getting any syntax errors? Check the output. Otherwise try Player.Character:MoveTo(Vector3.new(-30, 4, 110);

0
Has a red line under it when I did yours. mnaj22 44 — 10y
0
He forgot a ) Thewsomeguy 448 — 10y
Ad
Log in to vote
0
Answered by
mnaj22 44
10 years ago

Wait sorry...

Player = game.Players.LocalPlayer
if script.Parent.Parent.Name ~= "GO!" or "Waiting.." then
    script.Disabled = true
else
    script.Disabled = false
end

function onTouch()
    Player.Character.Torso.CFrame = CFrame.new(-29.799, 4, 109.567)
    Player.Character.Humanoid.WalkSpeed = 0
    wait(10)
    Player.Character.Humanoid.WalkSpeed = 16
end

script.Parent.Touched:connect(onTouch)

Hope this made it more viewable.

Log in to vote
0
Answered by 10 years ago

http://wiki.roblox.com/index.php?title=Teleport_(Method) http://wiki.roblox.com/index.php?title=Teleportation

Or try this.

player = game.Players.Player --you might want to change this... target = Vector3.new(20, 10, 20) --...and this

function fadeTo(a, b, c) for transparency = a, b, c do --go from a to b, counting by c

    for _, part in pairs(player.Character:GetChildren()) do
    --for each of the objects in the character,

        if part:IsA("BasePart") then
        --check if it's a part, and if so

            part.Transparency = transparency
            --set its transparency
        end
    end
    wait(0.1)
end

end

fadeTo(0, 1, 0.1) --fade out, player.Character.Torso.CFrame = target --teleport the player fadeTo(1, 0, -0.1) --fade back in

Log in to vote
0
Answered by 10 years ago

Do this in a regular script, also put the script in the part.

function Touch()
    p = script.Parent:FindFirstChild()
    if(p.Humanoid ~= nil) then
        p.Torso.CFrame = CFrame.new(0,0,0) --Change 0,0,0 to the position you want
end

script.Parent.Touched:connect(Touch)
Log in to vote
0
Answered by 10 years ago

Try this. (I'm assuming you want a part where you get teleported on touch)

function onTouch(h)
    if (script.Parent.Parent.Name == "GO!" or script.Parent.Parent.Name == "Waiting..") then
        local Player = game.Players:GetPlayerFromCharacter(h.Parent)

        if Player then
            Player.Character.Torso.CFrame = CFrame.new(-29.799, 4, 109.567)
            Player.Character.Humanoid.WalkSpeed = 0
            wait(10)
            Player.Character.Humanoid.WalkSpeed = 16
        end
    end
end

script.Parent.Touched:connect(onTouch)
Log in to vote
0
Answered by
jmt99 35
10 years ago

You can do this,

Workspace.PLAYER:MoveTo(Vector3.new(0, 0, 0))

and then replace the coordinates to what ever you like.

But, you can also teleport your character to a specific part.

Workspace.PLAYER:MoveTo(Workspace.Part.Position)

Answer this question