I'm trying to get this server script to create one raft for each player. This is what I got at the moment, any help?
The answer will be credited in my game: https://www.roblox.com/games/2436224110/Voteable
local RepStorage = game:WaitForChild("ReplicatedStorage")
local Remote = RepStorage:WaitForChild("GameRemote")
--Wait for players
game:WaitForChild("Players")
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("Create Rafts")
--Raft1
for i = 1,PlayerAmount do
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)

1 comment
you cant change a array into a number