I need a way to wait for all the players to be loaded in then do my stuff.
This is what I have at the moment:
local RepStorage = game:WaitForChild("ReplicatedStorage")
local Remote = RepStorage:WaitForChild("GameRemote")
--Wait for players
local WaitingPlayers = game:GetService("Players")
WaitingPlayers.CharacterAdded:Wait()
wait(1)
--FireClient
Remote:FireAllClients()
print("Countdown has been fired")
--FireClient
Remote.OnServerEvent:Connect(function(player)
local Players = game.Players:GetPlayers()
local PlayerAmount = tonumber(#Players)
print(PlayerAmount)
print("Create Rafts")
for i = 1,PlayerAmount do
wait(0.1)
local Raft1 = game.ReplicatedStorage.Minigames.StartingMinigame.CloneableRaft:Clone()
Raft1.Parent = game.Workspace.Minigames.RaftRace.Rafts
Raft1.Name = "Raft1"
Raft1:MoveTo(Vector3.new(323.95, 0.261, -63.462))
game.Workspace[player.Name].HumanoidRootPart.CFrame = CFrame.new(Raft1.Spawn.Position)
wait(0.1)
game.Workspace[player.Name].Humanoid.WalkSpeed = 0
game.Workspace[player.Name].Humanoid.JumpPower = 0
end
end)
I keep on getting errors on line 6.

2 comments
the Player service doesn't have a CharacterAdded event, each player has their own individual CharacterAdded event
try player added then character added