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.

01local TeleportService = game:GetService("TeleportService")
02local Players = game:GetService("Players")
03 
04 Players.PlayerAdded:Connect(function(player)
05    local followId = player.FollowUserId
06    if followId and followId ~= 0 then
07        local success, error, placeId, jobId = pcall(function()
08            return TeleportService:GetPlayerPlaceInstanceAsync(followId)
09        end)
10        if success then
11            TeleportService:TeleportToPlaceInstance(placeId, jobId, player)
12        end
13    else
14        print("Player isn't following someone")
15        end
16    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