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
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