my output says that it expected <eof> but got 'end' can someone help and tell me whats going on?
Asked by
4 years ago Edited 4 years ago
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local MapsFolder = ServerStorage:WaitForChild("Maps")
local Status = ReplicatedStorage:WaitForChild("Status")
local GameLength = 50
local reward = 50
while true do
Status.Value = "Waiting For Enough Players"
001 | repeat wait( 1 ) until game.Players.NumPlayers > = 2 |
003 | Status.Value = "Intermission" |
009 | for i, player in pairs (game.Players:GetPlayers()) do |
011 | table.insert(plrs,player) |
017 | local AvailableMaps = MapsFolder:GetChildren() |
019 | local ChosenMap = AvailableMaps [ math.random( 1 ,#AvailableMaps) ] |
021 | Status.Value = ChosenMap.Name.. " Chosen" |
023 | local ClonedMap = ChosenMap:clone() |
024 | ClonedMap.Parent = workspace |
026 | local SpawnPoints = ClonedMap:FindFirstChild( "SpawnPoints" ) |
028 | if not SpawnPoints then |
029 | print ( "Spawnpoints not found!" ) |
032 | local AvailableSpawnPoints = SpawnPoints:GetChildren() |
034 | for i, player in pairs (plrs) do |
036 | character = player.Character |
040 | character:FindFirstChild( "HumanoidRootPart" ).CFrame = AvailableSpawnPoints [ 1 ] .CFrame + Vector 3. new( 0 , 10 , 0 ) |
041 | table.remove(AvailableSpawnPoints, 1 ) |
046 | local Sword = ServerStorage.Sword:Clone() |
047 | Sword.Parent = player.Backpack |
049 | local GameTag = Instance.new( "BoolValue" ) |
050 | GameTag.Name = "GameTag" |
051 | GameTag.Parent = player.Character |
063 | Status.Value = "Get Ready To Play!" |
067 | for i = GameLength, 0 ,- 1 do |
069 | for x, player in pairs (plrs) do |
072 | character = player.Character |
074 | if not character then |
078 | if character:FindFirstChild( "GameTag" ) then |
079 | print (player.Name.. " is still in the game" ) |
083 | print (player.Name.. " has been removed" ) |
089 | print (player.Name.. " has been removed" ) |
093 | Status.Value = "There are " ..i.. "seconds remaining, and " ..#plrs.. " players left" |
097 | Status.Value = "The winner is " ..plrs [ 1 ] .Name |
098 | plrs [ 1 ] .leaderstats.peons.Value = plrs [ 1 ] .leaderstats.peons.Value + reward |
100 | elseif #plrs = = 0 then |
101 | Status.Value = "Nobody Won" |
104 | Status.Value = "Times Up! >:(" |
end
print ("end of game")
for i, player in pairs(game.Players:GetPlayers()) do
character = player.Character`
03 | if character:FindFirstChild( "GameTag" ) then |
04 | character.GameTag:Destroy() |
07 | if player.Backpack:FindFirstChild( "Sword" ) then |
08 | player.Backpack.Sword:Destroy() |
12 | if character:FindFirstChild( "Sword" ) then |
13 | character.Sword:Destroy() |
end
ClonedMap:Destroy()
Status.Value = "Game Ended :("
wait(2)
end`
ServerScriptService.main script:164: Expected <eof>, got 'end' - Studio - main script:164