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

I got a teleport script but I die when I teleport?

Asked by 2 years ago
Edited 2 years ago

So if i teleport i get under the "island" and i instantly die, how can I fix this

portal.Touched:Connect(debounce(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local character = hit.Parent
        local player = Players:GetPlayerFromCharacter(character)
        local rebirths = player.leaderstats.Rebirths.Value
        if rebirths >= tonumber(portal.Name) then
            character.HumanoidRootPart.CFrame =  destination.CFrame
        end
    end
end))
0
i guess destination is a Part located within Workspace? xXMadonXx 190 — 2y

1 answer

Log in to vote
0
Answered by
xXMadonXx 190
2 years ago
Edited 2 years ago

The script itself is working.

My guess is that the CFrame you are teleporting to is somewhere out of Bounds where Roblox kills the player (a.e. too far down)

Try using Position and Orientation instead of CFrames if you are unsure.

0
Maybe it is beceause my thing is not on the baseplate but further away? ThijnGamerYT 13 — 2y
0
if its away sideways it shoul not be a problem normally. but if you fall into the void you are going to die. try putting it above the baseplate xXMadonXx 190 — 2y
0
i put it above the baseplate, but it doesnt teleport me on it, it teleports me under the baseplate, that is probs the reason that it insta kills me, but I dont know how to fix that ThijnGamerYT 13 — 2y
0
move it up from the ground and anchor it? (also maybe enable noCollide) xXMadonXx 190 — 2y
View all comments (2 more)
0
You are teleporting the middle of the body to that part. So do not make it too low xXMadonXx 190 — 2y
0
Oh I fixed it, I thought I anchored it but ig not, thanks! ThijnGamerYT 13 — 2y
Ad

Answer this question