#If everyone dies before the round ends the game breaks
1 messages · Page 1 of 1 (latest)
this doesnt look like a round timer.
and when you say the game breaks - break how, are you getting any script errors?
the round just doesnt end
it ends fine if theres one person left when the script activates
wheres your round timer
Its meant to end when theres 1 player left not when the timer ends
well you still haven't shown contents of self:EventTimer or self:HandleEvent so we can only assume what's going on in those, but if you pay veery careful close attention
i asked if you were getting any script errors
i dont think so ill check
** You are now Level 2! **
Because no one is in the round and it randomly gets someone in the round
whenever i try to edit it to make no one win if everyone dies it breaks the whole rest of the script
yea thought so, so if everyone dies then #self.Players is 0, and then when you try to pick a winner which you assume exists, even though it doesn't, local Winner = self.Players[math.random(1,#self.Players)], this is the part where you tell me what you think is going to happen when #self.Players is equal to 0 here?
Yeah i figured that part out i just undid all the changes i made sinse my changes were just making it worse
who wrote this code in the first place?
I copied it from a tutorial that never got finished....
and now you can't get someone else's code to do what you want? oh my
color me surprised, who'd have seen that one coming? who'da thunk, who'da guessed that you copying code you don't understand would end up this way! 
No i knew it would end up like that.......
in all seriousness you aint going to get anywhere just by stitching code, that is copy+pasting existing code and changing it slightly to try and get something that kind-of does what you want
vibe coding with ai is the same
well the game is functional other than that one part.....
lol yea 'functional' i'm sure you've got all your gamepasses added in already 
No it doesnt have gamepasses
anyway yeah as you suspected yeah this is all you need to do, just handle the case where there's no players left, e.g if 2 players die on the same frame, pretty straight forward and very simple to do. or it would've been if you had wrote that code yourself
its like if #self.Players < 1 then ... handle no players() ... else handlewinner() end literally an if statement very simple
wait i just realised what i tried before made no sense at all
...
i tried to make it so that if #self.Players = 0 then it = nil but it was already nil if it was 0
...
you need a basic understanding of coding fundamentals to write new code, this may help you: https://create.roblox.com/docs/tutorials/fundamentals/coding-1/coding-fundamentals there's no shortcuts to this.
yeah you can do winner = if players==0 then nil else players[1] if you want to. there's an infinite number of ways to address most problems
each solution being equally correct as the last
the point is you should expect to make mistakes and bad code.
and that's okay. it will be bad code, but make enough of it and eventually it won't be bad code anymore 👍
Yeah but whenever i try to make something specifically for getting better at scripting i get bored so i have to actually make the code make something so i dont just give up
yeah make stuff at your skill level, don't jump in the deep end and try to make a combat game as your first project
i've seen that mistake made many, many times
make +1jump/sec or a button simulator for example
if you can't handle +1jump/sec, you aren't making anything else.
@violet sky i seen you around and u look
experienced, have you made any games?
i have made several across roblox and other platforms
have you made any games?
Not yet
still learning
i'd rather not advertise. why tho
i want to see good games
@violet sky
Why wouldn't you want me to see
its just players trying other player's games
i didn't say they were good
i'd rather not advertise
you are not my target audience neither is really anyone else here