I’m using roblox’s module script for teleporting, but it’s saying “Invalid list of players for teleport.”
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")
local SafeTeleport = require(ServerScriptService.SafeTeleport)
local TARGET_PLACE_ID = 9671855606 -- replace with your own place ID
local playerToTeleport = Players:GetPlayers()[1] -- get the first player in the game
script.Parent.Touched:Connect(function(v)
if v.Parent:FindFirstChildWhichIsA("Humanoid") then
SafeTeleport(TARGET_PLACE_ID, {playerToTeleport})
end
end)
Sorry I’m getting back so late, I completely forgot about this. I tried the UserId, but it said “variable playerToTeleport defined at line 8 is never initialized or assigned”.