#Equipping Objects Based on Player's Index
1 messages · Page 1 of 1 (latest)
Give each object a tag, like Flashlight0, Flashlight1, Flashlight2, etc all the way up to max player count - 1, (So if the game has a max of 10 players, you would have objects tagged Flashlight0 through Flashlight9)
When the local player joins, equip the object with the tag Flashlight concatted with your room index
Oh I got it to work but thank you!
On a seperate note, if someone is already holding that flashlihgt, how would I combat that?
if you are using room index, that shouldnt be possible
however, if you are doing nothing to prevent a user from dropping their flashlight, which is always nice:
Whoever owns the flashlight knows what flashlight is theirs, so using an Event Receiver (Update 30hz), you need to check "Is there a person who is not me holding my flashlight?", you can do this with Rec Room Object Get Last Equipping Player
If the object is currently being held and the person holding it is not local, unequip flashlight
Ok thank you!
One question that comes with that... There are 6 flashlights in a list and I'm getting the element of that list with the player's room index. Do I use that index's value as the object for the last equipping player?
Where are you getting this list from?
Here's a ss just in case
All the trigger handles which are "flashlights"
And how are you getting this list? a List Create?
yes
Then yes, this setup is perfect
cool
If you were using Rec Room Object Get All With Tag, that would be different, as the order of that list changes frequently and is not synced
yeah...
Oh my lord I'm reading this almost a year later THANK YOU SO MUCH