I’m making a minigame type game but, this script doesn’t want to work
does any think they can help fix it? If you want I can send a file of the game if you want to see the whole thing to help you fix it. I’ve looked to see if there are any spelling errors anywhere but, couldn’t find any, if you know how to fix it could be send me a fixed copy? Thanks in advanced.
If you send the whole file, I will load it in Studio and take a look.
I do see one error:
for i = 1,#plrs do
local num = math.random(1,8)
should be
for i = 1,#plrs do
local num = math.random(1,numberofteleportparts)
Leaving the syntax and bugs aside, this code has design issues. It might be helpful to talk about what you are trying to accomplish.
Ok, I’m looking into it. Give me a few minutes.
The first thing I see is this error:
[13:32:17.653 - Games is not a valid member of ReplicatedStorage]
Your folder in Explorer is named “games”, but in the code
you reference it as “Games”
next, I get this error in the “Output” window:
[Workspace.Game Test.Model.Part.Script:3: Expected ‘)’ (to close ‘(’ at column 5), got ‘then’]
In your model part script the closing parenthesis is in the wrong place:
if (h ~=nil then)
should be:
if (h ~=nil) then
Also there is no closing end to the:
if (h ~=nil) then
(missing end)
I fixed everything you talked about but, something things still aren’t working. The round doesn’t end when all players die and the code doesn’t say what the game’s name is.
gametest.rbxl (23.4 KB)
The game’s name isn’t showing because it is over written immediately by your repeat/until loop for the game countdown. I appended the game name in front of the countdown as an example of a possible solution. Or you could put another delay in between the end of the plrs for loop and before the start of the repeat until. The game doesn’t end when all players die because in the repeat until loop you do not check to see if any players are left. If you need help with that let me know.
I’m not a big expert on these types of scripts so I don’t really get much of this stuff, I could use a but of help trying to these parts of the script working.
No problem. Is what you uploaded all of what you have so far? If so, let me see what I can do for you.
Yes, the baseplate map I sent has everything i’ve worked on so far.
Where are the teleport parts going to be placed? Right now it seems that the player spawns in the wrong spot and it affect/shifts the parts of the mini game. Where is it that you intend the players to spawn?
Also, is you design to wait for players to accumulate, then start a random mini game, play the game until everyone dies or someone wins and then start another mini game when the previous one finishes? Is there a minimum number of players?
gametest.rbxl (24.9 KB)
Here is an edit that solves your issues. Part properties and code were changed, so review it carefully. Its my best guess at what you were intending. You know what? I couldn’t get over that kill brick. I am no good at playing these games…
This fixed all of the problems but, the one thing I’ve noticed is that you made it that the player can’t move the camera or there player. Is there a reason that you did this, or is this unintentional? If it’s unintentional I’ll try to find a way to fix it but, If it’s intentional, it would be nice if could tell how to fix it.
That is because the character is not loaded. When the character loads, the character’s camera is activated. This is a design issue. Auto Character loading is disabled so you can control when the character is loaded. I have to go, will get back later. Ok only have a couple minutes. So, It all depends on how you want the game to flow. Do you have a staging area where you want the players to wait during intermission. The players could be loaded to such a place and then moved to the mini game. What do you want to do. Right now it just halts loading the avatar’s until the game starts, then it spawns the player’s avatars at one of the random teleport locations. Remember I have no idea what you design requirements are.
What I want to do is make a staging area where the players wait for while the intermission goes on. I can make the points and win system. All need is to make it so, you can control the players while you wait in the lobby.
Edit: Nevermind, I got the script working the way I wanted it to.