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

How to teleport players to another map or something like that?

Asked by 9 years ago

I don't know pretty much coding so I need some help. And is this correct?

player = game.Players.Player 
target = Vector3.new(20, 10, 20) 

function fadeTo(a, b, c)
    for transparency = a, b, c do


        for _, part in pairs(player.Character:GetChildren()) do


            if part:IsA("BasePart") then


                part.Transparency = transparency

            end
        end
        wait(0.1)
    end
end

fadeTo(0, 1, 0.1) 
player.Character.Torso.CFrame = target 
fadeTo(1, 0, -0.1) 

1 answer

Log in to vote
0
Answered by
Rhyles 80
9 years ago

Instead of doing target = Vector3.new(20, 10, 20), do target = CFrame.new(20, 10, 20).

This is because when you assign the Torso.CFrame property, it requires a CFrame value, and not a Vector3 value.

I hope this helps! :)

0
Thx :) TheCoolRobloxian4 20 — 9y
Ad

Answer this question