Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Expected 'End' got <eof> Error? Help me

Asked by 4 years ago

I am working on a killer game. I made a main script that will control whole game (Round).

If you see any error please tell me

Here's output:

14:35:57.017 - Jeff (Still in development) @ 04 mar 2020 14:35 auto-recovery file was created
14:35:59.052 - ServerScriptService.MainScript:181: Expected 'end' (to close 'do' at line 15), got <eof>
kujekmarek applied edits to script MainScript
GUI Rescale Error - 411 Error | Please DM TheReal4Cedar123.

Main Script in ServerScriptService

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local PlrCamera = game.Workspace.CurrentCamera

local ServerStorage = game:GetService("ServerStorage")

local Status = ReplicatedStorage.Status

local Player = game:GetService("Players").LocalPlayer

local MapsFolder = game.ServerStorage.Maps

local GameLenght = 120

while true do

    wait(1)

    --if game.Players.NumPlayers <2 then
        --Status.Value = "Waiting for 2 players!"

        --repeat wait(1) until game.Players.NumPlayers >= 2
        --Countdown (i used different style but i didn't work so i made it this way lol)

        Status.Value = "Break 20"
        wait(1)
        Status.Value = "Break 19"
        wait(1)
        Status.Value = "Break 18"
        wait(1)
        Status.Value = "Break 17"
        wait(1)
        Status.Value = "Break 16"
        wait(1)
        Status.Value = "Break 15"
        wait(1)
        Status.Value = "Break 14"
        wait(1)
        Status.Value = "Break 13"
        wait(1)
        Status.Value = "Break 12"
        wait(1)
        Status.Value = "Break 11"
        wait(1)
        Status.Value = "Break 10"
        wait(1)
        Status.Value = "Break 9"
        wait(1)
        Status.Value = "Break 8"
        wait(1)
        Status.Value = "Break 7"
        wait(1)
        Status.Value = "Break 6"
        wait(1)
        Status.Value = "Break 5"
        wait(1)
        Status.Value = "Break 4"
        wait(1)
        Status.Value = "Break 3"
        wait(1)
        Status.Value = "Break 2"
        wait(1)
        Status.Value = "Break 1"
        wait(1)
        Status.Value = "Break ended"
        wait(1)
        Status.Value = "Intermission 10"
        wait(1)
        Status.Value = "Intermission 9"
        wait(1)
        Status.Value = "Intermission 8"
        wait(1)
        Status.Value = "Intermission 7"
        wait(1)
        Status.Value = "Intermission 6"
        wait(1)
        Status.Value = "Intermission 5"
        wait(1)
        Status.Value = "Intermission 4"
        wait(1)
        Status.Value = "Intermission 3"
        wait(1)
        Status.Value = "Intermission 2"
        wait(1)
        Status.Value = "Intermission 1"
        wait(1)
        Status.Value = "Intermission"

        game.ReplicatedStorage.IsInGame.Value = true

        local plrs = {}

    for i, player in pairs(game.Players:GetPlayers())   do
        if player then
            table.insert(plrs,player)

        end
    end


wait(2)

local AvailableMaps = MapsFolder:GetChildren()

local ChosenMap = AvailableMaps[math.random(1,#AvailableMaps)]

Status.Value = ChosenMap.Name.." Chosen"

local MapSpawn = ChosenMap:Clone()
MapSpawn.Parent = workspace

wait(2)

local Killer = {}

local KillerChosen = plrs[math.random(1,#plrs)]

Status.Value = "The killer is "..KillerChosen.Name

table.insert(Killer,1,KillerChosen)

wait(2)

wait()


local Survivors = {plrs}

table.remove(KillerChosen)



--Teleporting, camera and knife 

wait()

Killer[1].Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(166.4, 110.3, 97.6)

wait(2)

game.ReplicatedStorage.CameraKillerBox:FireAllClients(plrs)

print("First event fired")

wait(8)

game.ReplicatedStorage.CameraKillerBoxBack:FireAllClients(plrs)

local Knife = game.ServerStorage:WaitForChild("Knife"):Clone()
Knife.Parent = Killer[1].Backpack

print("Second event fired")

local Spawnpoints = ChosenMap:FindFirstChild("SpawnPoints")

local SpawnPointsFound = Spawnpoints:GetChildren()

for i, player in pairs(Survivors) do
        if player then
            character = player.Character

        wait(1)

        if character then
            character:FindFirstChild("HumanoidRootPart").CFrame = SpawnPointsFound[1].CFrame + Vector3.new(0, 10, 0)
            table.remove(AvailableSpawnPoints,1)

            local KillerSpawn = ChosenMap:FindFirstChild("KillerSpawn")

            Status.Value = "Hide! The killer is coming!"

            wait(10)

            Killer[1].Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(KillerSpawn.CFrame)

            Status.Value = "Killer is here!"

            wait(2)
        end
    end
end
0
both the while loop and the first if statement have no end's, you need to include them after the initial 3 end's DeceptiveCaster 3761 — 4y
0
So how much ends should i add and where (What lines) because i added them and its still not working kujekmarek 24 — 4y
0
2 end's after your very last end in the script DeceptiveCaster 3761 — 4y

1 answer

Log in to vote
0
Answered by
bum5Br 97
4 years ago

The console says it all, in your while true loop you have 3 statements, but only two ends. just add an end where you want your while true loop to finish.

Ad

Answer this question