#how can i fix this?

1 messages · Page 1 of 1 (latest)

lapis grail
#

i tried making a system to give a player a gun Handel whenever it sets there position but the way i did it only gives players guns sometimes how would i make it to all the time? ( i know its because i used a random chip but i don't know any other chip that does the same thing)

lapis grail
#

something like this?

lapis grail
#

yeah, after i ran each object through a rec room object variable it worked thank you @digital narwhal

thorny trout
lapis grail
#

and i changed the input for the for each to a get all with tag and the input for the is valid to the list

thorny trout
lapis grail
lapis grail
thorny trout
lapis grail
#

for my case it cycles the objects so people always get an object

thorny trout
#

For will execute from From to To

If you execute from 0, to 5:
The "Loop" output will execute 5 times, each time, the index increments by 1, meaning it will execute in order for [0, 1, 2, 3, 4]
The "Done" output will execute AFTER the loop, and will also increment the index by 1, meaning it will execute when the index is 5
All of this will be done at the exact same Cv2 tick

This is what it means when it says "To" is EXCLUSIVE whilst "From" is INCLUSIVE

For Each is For except:
From = 0
To = List Get Count(InputList)
Item = List Get Element(InputList, ForIndex)

This means, "Loop" will fire for every item in the list, in order from First to Last, and "Done" will fire with an invalid item, as the index it is trying to get does not exist

WITH ALL THAT BEING SAID

  • Is the item output from your For Each invalid? YES
    Why? BECAUSE ITS NOT A VALID INDEX
    Why does it work when using "Loop"? BECAUSE like I said before, "Loop" will fire when the item is valid, "Done" will fire when the item is invalid, the reason the result is always invalid is because:
  • The loop has not been run yet, so it doesnt have any list initialized inside it
  • The loop has been run, you are seeing an invalid index which does not exist

Go ahead and try creating a list variable, and using List Add to add every item from the list into the list variable, notice how the list variable contains every item in the list?

#

@lapis grail

#

with all of THAT being said

No, you are wrong, your For Each outputting a list is a bug, so delete it, respawn it, it shouldnt have that list output

lapis grail
#

is my room buggin then?

thorny trout
#

ITS JUST SHOWING AN INVALID INDEX

#

YOU CANT SEE EVERY ITEM IN THE LIST AT THE SAME TIME

lapis grail
#

it was just to show

thorny trout
lapis grail
#

let me show you what i have going on rq

thorny trout
thorny trout
lapis grail
thorny trout
#

i actually quit

#

im not doing this anymore

lapis grail
#

@thorny trout you wanna come see my circuits?

thorny trout
#

no

foggy moth
lapis grail
#

i swear it works man i'v tested it

#

plus there isint a list connected to it "Rec Room Object get All With Tag" is conected to the "For loop"

thorny trout
#

its a recent bug

foggy moth
lapis grail
#

it 100% works

#

he meant with the "For loop" Chip

#

he said it shoulding be possible to connect a list to a For Loop but if you make one for rec room objects it works just fine

#

his big brain overloaded fr