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.
01 | local TeleportService = game:GetService( "TeleportService" ) |
02 | local Players = game:GetService( "Players" ) |
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) |
11 | TeleportService:TeleportToPlaceInstance(placeId, jobId, player) |
14 | print ( "Player isn't following someone" ) |