I need to make a script that creates one boat for each player...
This is what I got:
01 | local RepStorage = game:WaitForChild( "ReplicatedStorage" ) |
02 | local Remote = RepStorage:WaitForChild( "GameRemote" ) |
03 |
04 | --Wait for players |
05 | game:WaitForChild( "Players" ) |
06 | wait( 1 ) |
07 | --FireClient |
08 | Remote:FireAllClients() |
09 | print ( "Countdown has been fired" ) |
10 | --FireClient |
11 | Remote.OnServerEvent:Connect( function (player) |
12 | --Script goes here |
13 | end ) |
how to know how many players
1 | local players = game.Players:GetPlayers() |
2 | print (#players) |
spawn ship to every player
1 | for i,v in pairs (game.Players:GetPlayers()) do |
2 | local clone = game.ServerStorage.Ship:Clone() |
3 | clone.Parent = workspace |
4 | clone:MoveTo(v.Character.Head.Position) -- do any position of any body part |
5 | end |