So, I have been coding a some minigames for a game I am making, and I need help because I can’t figure out to award points to more than one player or list out more than one winner. Can anyone help me on this cuz I have been stuck on this for a couple of days and I have tried everything that I know how to do (I’m new to coding roblox games.) Below is a screenshot of the code that I have in there and it shows which lines aren’t working.
line 87 why are you going through a for loop and instantaneously changing the value of status until i = … children? would it not be #children? (number of children)
although I don’t really see anything else that is wrong.
I’m going through that loop cuz in my head it made sense. I really don’t know what I am doing. got any tips on how to make it work?
I’ll tell you if fixing it works
It didn’t work. Got any Ideas?
honestly it looks fine to me as is. you go through the list right? if u want to verify that just print stuff like children[i].Name.
aside from that you mention listing more than one winner but you change status.value through each itteration so I’m not sure how you are trying to list
personally i’ve never seen “getfullname” im not entirely sure what that does i checked api and it looks weird, if you can print it aswell maybe it can help
it doesn’t award any points either though, I really don’t know how to award points to more that 1 person
have you tried doing
for i, v in pairs (children) do
and the v.Name is == children[i].Name (unless children[i].Name is not right)
Ok, I’ll try it out and tell you if it works.
It didn’t work. I’m only testing it out with one person(Me) and it wouldn’t even award me the win and points. It also didn’t say the winner. this is strange because the other 2 games work perfectly fine but they are only able to have 1 winner.
Question, are you sure that 1th index of this table, has the first player who triggered the win event?
I would recommend storing winners in a table and inserting them inside of it.
All you have to do is create a bindable event/function and make a invoke handler (some function).
The win event for this game is only triggered when the timer runs out to 0 and there are still people alive. I don’t know how to code for awarding the points to those still alive and listing out all of the winners in a way that works because this apparently doesn’t. Got any ideas?
Wdym, “it doesn’t work”?
If you want me to help you, make it more precise.
What is happening, what is not happening.
Just got back to my desk, so what doesn’t work is that after the minigame finishes when the timer runs out, it doesn’t award any points/wins or list any winners. The minigame itself works, just not the part where is should acknowledge the people who won.
Is it printing anything, like an error or something?
Try printing before the if statement and after it and show me the output
It wasn’t printing anything, but I think I figured it out just now, I will code it in later when I get home and I’ll tell you if it works.
okso I think you should add print on line 75 that prints number of players.
try changing those to v
I believe that the “v” variable is an instance, but who knows :).
And yes, you can create table, with indexes made from the instances, but this particular table is made out of number indexes.