How do I make my own piggy-style game?

Hello, the lost people,

I am working on my own piggy game called Caty[Alpha], I have an issue with the round system. Can someone help me with how to make a round system from this:image and teleport player to the map spawner

I do not know how you expect up to help you. You have given us a goal with nothing else. This is “Scripting Support”, We can help guide you or help fix bugs/problems. It’s rare that full scripts, like what you are asking for, would be just given out. If you have anything in those scripts that you show, copy and paste the code here so we can help you.

Those are my script

GameLogic:

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local roundModule = require(script.Round)

local playerModule = require(script.Player)

local status = {

"Intermission",

"MapVote",

"ModeVote",

"Game"

}

local roundInfo = ReplicatedStorage:WaitForChild("RoundInfo")

local function intermission()

print(status[1])

roundModule.countdown(status[1], 10)

print(status[2])

roundModule.countdown(status[2], 10)

print(status[3])

roundModule.countdown(status[3], 10)

end

local function startGame()

print(status[4])

roundModule.countdown(status[1], 8)

end

while true do

intermission()

startGame()

end

Round:

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local roundInfo = ReplicatedStorage:WaitForChild("RoundInfo")
local events = ReplicatedStorage:WaitForChild("Events")

local roundModule = {}

function roundModule.countdown(status, clock)
	roundInfo.Status.Value = status
	roundInfo.Timer.Value = clock
	for i=clock, 1, -1 do
		roundInfo.Timer.Value -= 1
		wait(1)
	end
end

return roundModule

Is there any way to make a better intermission script?

I think you should use os.time to keep track of your timer instead. I don’t think you have to but it’s recommended. You can also reduce this to one script rather than use different modules for one function. Also you don’t really need that while true do. This is my opinion but I guess your script is fine, other than missing a voting system and map selection system which if you are trying to make a piggy like game you will probably need.


Under these line’s you can clone the chosen map from ServerStorage to workspace, loop through all the players and teleport them to the a random spawn inside the map.

After the round is over respawn all players if their inside the game through a bool value or something else.


So when you are making a piggy-style game, you have to plan it. But I won’t get to that part yet, onto the problem.

So I don’t have a scripting fix, BUT I do have something you should probably do before you start scripting your game.

So when I am writing my scripts, I always wonder"am I doing this right?" and to fix my problem I did one that REALLY helped me. Looking at other people’s scripts, now I know what you are thinking “so I copy their code?” No not that, just look at their code like take Alvinbloxes piggy tutorial, looking at what he did can help you with your decisions for coding. Like you could look at his timer and see how he scripted it and maybe yours will be different. For example, you forgot to check if there are enough players to start the round. Don’t know how to do that or need help? You can just look at their code and you can see the decisions they made, and if it is confusing you can ask us or look at the dev forum.

So basically you could just look at other people’s scripts and it will help you make a piggy game like if you want to know the steps on making a piggy game, you could look at their script and then you know that you need to put all players in a table here and there, etc…

well that’s all I can say!