I've been trying to make a script that picks two random players and teleports them to different spawns in a round system. Can someone provide me their script? Mine has been not working, and I can't seem to find a fix anywhere. I got this code from a YT video and tried to edit it
local roundLength = 60 local intermissionlength = 5 local InRound = game.ReplicatedStorage.InRound local Status = game.ReplicatedStorage.status local FightingSpawn = game.Workspace.FightingSpawn local specSpawn = game.Workspace.specSpawn local FightSpawn = game.Workspace.FightSpawn2 players = game.Players:GetChildren() players[math.random(1, #players)]:MoveTo(Vector3.new(Location1) ) players[math.random(1, #players:MoveTo(Vector3.new(Location2) ) local function roundTimer() while wait() do for i = intermissionlength, 1 , -1 do InRound.Value = false wait(1) Status.Value = "Intermission: ".. i .. "seconds" end for i = roundLength, 1 , -1 do InRound.Value = true wait(1) Status.Value = "Time Left:".. i .. "seconds" end end end spawn(roundTimer)
heres the script for the timer
local status = game.ReplicatedStorage.status local Timer = script.Parent.Timer status.Changed:Connect(function() Timer.Text = status.Value end)
Your issue is quite simple. You're trying to call the :MoveTo()
method of Model on a Player Object. This of which isn't an existing method of it's class. You'll need to reference the Character rig to call this function on to actively adjust it's position properly:
wait() local Players = game:GetService("Players"):GetPlayers() local Player = Players[math.random(#Players)] local Character = Player.Character or Player.CharacterAdded:Wait() Character:MoveTo(workspace.Part.Position)