#help pls

1 messages · Page 1 of 1 (latest)

left dragon
#

I’ve tried searching but, I couldn’t find anything, could anyone tell me how I could make a button that, when pressed, equips a weapon to the player who pressed the button pls

fierce talon
# left dragon I’ve tried searching but, I couldn’t find anything, could anyone tell me how I c...

Give each one of your gun objects a tag, say, Gun
You should also give them a unique tag containing a number, if you have a max player count of 10, you are going to want 10 guns, each with the tags Gun, and each with their own unique tag, Gun0, Gun1, Gun2, etc

Now, Player Get Room Index returns a unique number per player, and the number has to be between 0 and the max number of players, subtract 1, so if your max player count is 10, it will be between [0,9], which is 10 numbers

You can use To String to convert this index into a String type, and then, using String Concat, concat this string with the word Gun to get the string Gun[Index], eg. if I was index 5, I would get the string Gun5

Using Rec Room Object Get First With Tag, you can get the first object with this string as a tag, so if I input my string, Gun5, It would output the gun with the tag Gun5,

Using Equip Object To Player, I can equip this gun to myself


On the more complex networking side of things, all you would need for this is Local Player and nothing else, as the button component inside its object board automatically localizes the execution to the player who pressed the button


If the above section about networking just confused you, check out this room:
https://rec.net/room/CA_Circuits241

*Early Access Room

In Circuits 241, you will gain a deep understanding of how Rec Room networking works, and how it affects your circuitry!

*Note: Early Access rooms may not work or perform well on all platforms yet. Please give us feedback as you try out the room using the clipboard tool in your backpack.

left dragon
#

how to give tag?

fierce talon
left dragon
#

ok

#

Do I change the max players in the This Room in settings?

fierce talon
left dragon
#

ok

#

btw I have 1 question

#

is rec room studio a pc thing or can I still access on console

fierce talon
#

Need PC

#

Its Unity

left dragon
#

ok ✅