✓ Accepted answer
Hello DataCardz!
There are a few issues with your script, here I'll go over each one and what I'd do.
local players = game.Players:GetChildren()
ROBLOX has a specific function to get players, rather than having to do GetChildren() of the players. You could do what's listed below instead.
local players = game:GetService('Players'):GetPlayers()
Moving onto line 04.
game.Workspace.Triggers.CabinTrigger:Destroy()
This script will try to run before Triggers, or CabinTrigger is loaded in. You should use :WaitForChild() just to be safe. Refer to the link for a better explanation on :WaitForChild().
Next up,
players[i].Character:MoveTo(game.Workspace.TeleportPoints.CabinTeleport1.Position)
Again, you should be using a WaitForChild() to make the script wait for CabinTeleport1. However, from the looks of it, you're destroying CabinTrigger before teleporting the player. Additionally, :MoveTo() you can not use :MoveTo() on the players character model itself. You're going to have to get the Players character humanoid and use :MoveTo().
players[i].Character:WaitForChild('Humanoid'):MoveTo(game.Workspace.TeleportPoints.CabinTeleport1.Position)
If this still does not work you need to ensure that:
A) CabinTeleport1 is not nil / is inside of the TeleportPoints folder.
B) This is a server script
C) This script is inside somewhere the server access / run
2 comments
You should use getplayers instead of get children and you can only use moveto on the humanoid not the character
u can use moveto on character