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

Expected end (to close function at line 77) got eof?

Asked by 4 years ago
Edited 4 years ago

Hello I am trying to make a Piggy game, and im a new scripter, and theres an error Expected end (to close function at line 77) got eof

Sorry the script is long, but please help

Script:

local module = {}

local status = game.ReplicatedStorage:WaitForChild("Status")

function module.Intermission(length) for i = length,0,-1 do status.Value = "Next round starts in "..i.." seconds" wait(1) end end

function module.SelectChapter() local rand = Random.new() local chapters = game.ReplicatedStorage.Chapters:GetChildren() --- Table of all map models local chosenChapter = chapters[rand:NextInteger(1,#chapters)]

return chosenChapter

end

function module.ChooseCookie(players)

local RandomObj = Random.new()

local chosenCookie = players[RandomObj:NextInteger(1,#players)]

return chosenCookie

end

function module.TeleportCookie(player) if player.Character then

    player.Character.Humanoid.WalkSpeed = 14

    local bat = game.ServerStorage.Tools.Sword:Clone()
    bat.Parent = player.Character        

    if player.Character:FindFirstChild("HumanoidRootPart") then
        player.Character.HumanoidRootPart.CFrame = game.Workspace.WaitingRoom.CookieWaitingSpawn.CFrame + Vector3.new(0,5,0)
    end

end

end

 function module.TeleportPlayers(players, mapSpawns)
--
--

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

        if character:FindFirstChild("HumanoidRootPart") then

        player.Character.Humanoid.WalkSpeed = 16

        local rand = Random.new()
        player.Character.HumanoidRootPart.CFrame = mapSpawns[rand:NextInteger(1,#mapSpawns)].CFrame + Vector3.new(0,10,0)

        end
    end
end

end

function module.Insertag(contestants,tagName) for i, v in pairs(contestants) do local Tag = Instance.new("StringValue") Tag.Name = tagName Tag.Parent = v
end end

local function toMS(s) return ("i:i"):format(s/60%60, s%60) end

function module.StartRound(length,cookie,chapterMap)

for i = length,0,-1 do

    if i == (length - 20) then
        module.TeleportPlayers({cookie},chapterMap.PlayerSpawns:GetChildren())
        status.Value = "Cookie is coming, dont get caught"
        wait(5)
    end

    status.Value = i
    wait(1)
end

end

return module

1
can you please format the code properly? Erie20 102 — 4y
0
that way, i am able to see what is on line 77, as the error points to it Erie20 102 — 4y
0
Yeah, please use the lua block for all of you code. IAmNotTheReal_MePipe 418 — 4y
0
when I put it in it did not put lua for all so im sorry Megasalamencexfly 0 — 4y

1 answer

Log in to vote
0
Answered by
Erie20 102
4 years ago

so the error says you need an end at line 77. you probably forgot an end statement. If you see any red lines in the script that is where there is something wrong

0
Wdym by end sttement Megasalamencexfly 0 — 4y
Ad

Answer this question