#why does teleport service say the value is unable to be cast

1 messages · Page 1 of 1 (latest)

wooden wharf
#

when i try to teleport the whole server it says "Unable to cast value to objects"

the code is ```lua local function evacuation()
game.ReplicatedStorage.stopMusic:FireAllClients()
local sound = Instance.new("Sound")
sound.Parent = workspace
sound.Looped = true
sound.SoundId = "rbxassetid://93477208949609"
sound:Play()
task.wait(10)
local bad = game:GetService("BadgeService")
local tele = game:GetService("TeleportService")
for i, plr in pairs(game.Players:GetPlayers()) do
bad:AwardBadgeAsync(plr.UserId, 3473962204182242)
bad:AwardBadgeAsync(plr.UserId, 3276114288757380)
tele:TeleportAsync(87217132139486, plr)
end
end

tardy raven
#

check the kinds of values it excepts

#

when typing it sometimes gives you that bar that gives a breif description

#

above that it should say the type of instance it takes

#

like strings

#

or numbers

wooden wharf
#

it accepts individual players too which makes me under the impression that it should work

tardy raven
#

ah ok

#

instead of sending one player at a time

wooden wharf
tardy raven
#

make a table of all players

#

and say tele:TeleportAsync(87217132139486, players)lua

#

it says it an send an array

#

so this should work!

wooden wharf
#

okay

junior juncoBOT
#

studio** You are now Level 1! **studio

tardy raven
#

if this is in studio then teleportservice doesnt work

wooden wharf
tardy raven
#

yeah

#

um

#

the only thing i think could happen is it thinks you arent a full player?

#

i think thats what it may mean by guest

lucid coral
#

yup

#

yall be helping anyone

wooden wharf
radiant sonnet
#

when you are on studio they think you are a guest

#

somethign like that

wooden wharf