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

After an hour of troubleshooting I still can't get this escape pod script to work. Why?

Asked by 3 years ago

I made a game sort of like Innovation Inc Spaceship.

I want to make it so that the Pod Endings are possible. I can get as far as getting the names of players inside of pods, but how exactly do I teleport them to another place? Here's my code so far.

if pod.Name == "Pod" then


        local pfft = planets -- planets is set earlier as the place id of the target planet
        print("Test Successful on first stage")
        for lol, seat in pairs(pod:GetChildren()) do
            if seat.Name == "Seat" then
                print("Test Successful on second stage")
                local weld = seat:FindFirstChild("SeatWeld")
                if weld then
                    print("Test Successful on third stage")
                    local humanoidroot = weld.Part1
                    local playerName = humanoidroot.Parent.Name
                    print(playerName)
                    print(humanoidroot)
                        -- Get player from characte
                            -- Teleport the player
                            TeleportToPlaceInstance(pfft, playerName)
                            print("Test Successful on final stage")
                end
            end
        end
    end

It just complains about "calling null".

0
What is the code for "TeleportToPlaceInstance"? mixgingengerina10 223 — 3y
0
It's just the code Roblox says to use for teleportation. ItzCorruptedz 0 — 3y

Answer this question