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

Follow player to place script gives error 'unable to cast string to int64'. Why is this?

Asked by 5 years ago
Edited 5 years ago

In simple terms, when you follow your friend into a universe by pressing the join button on the website, you get sent to the start place. This script teleports them into the place that their friend is in as soon as they join the start place.

local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")

 Players.PlayerAdded:Connect(function(player)
    local followId = player.FollowUserId
    if followId and followId ~= 0 then
        local success, error, placeId, jobId = pcall(function()
            return TeleportService:GetPlayerPlaceInstanceAsync(followId)
        end)
        if success then
            TeleportService:TeleportToPlaceInstance(placeId, jobId, player)
        end
    else
        print("Player isn't following someone")
        end
    end)
0
ask the discord Nuqz 0 — 5y
0
Which line is the error on? Ankur_007 290 — 5y
0
Line 11 ThePolite 26 — 5y

Answer this question