Hello! I am trying to make a system where a player’s username and a PlaceID are inputted to teleport a player. Whenever I try to run this code, I get errors. I am in testing it outside of studio and both inputs coming from the RemoteEvent are strings.
local Admin = 899253908
local TeleportService = game:GetService("TeleportService")
local function SendPlayer(Place, User)
local TrueUser = game.Players:GetUserIdFromNameAsync(User)
TrueUser = game.Players:GetPlayerByUserId(TrueUser)
TeleportService:Teleport(tonumber(Place), TrueUser)
end
game.ReplicatedStorage:FindFirstChild("TeleportPlayer").OnServerEvent:Connect(function(Player, TPPlayer, Place)
if Player.UserId == Admin then
SendPlayer(Place, TPPlayer)
else
Player:Kick()
end
end)