skRayFall icon indicating copy to clipboard operation
skRayFall copied to clipboard

weird hologram issue(pickup)

Open aaa8881 opened this issue 7 years ago • 0 comments

command /cholotest3:
	trigger:
		loop {location::holoitem::1::*}:
			create interactive client side holo object "ItemStack:Diamond Ore;" with id "%player%_%loop-index%" at loop-value to player
			broadcast "%loop-index% created &e%loop-value%"		

{location::holotiem::1::$name_of_this_hologram_in_String} = $location $ represents what type of data they are. so basically looping through that will create a client side hologram at loop-value which is LOCATION with different ID of "%player%_%loop-index%". For example, if {location::holoitem::1::heal} = 100,100,100 {location::holoitem::1::jump} = 200,200,200 {location::holoitem::1::thrust} = 300,300,300 and say my nickname is username1

hologram with ID "username1_heal" should be in 100,100,100 hologram with ID "username1_jump" should be in 200,200,200 hologram with ID "username1_thrust" should be in 300,300,300

These are done correctly. Things are produced in right location. However this code works weirdly

on hologram pickup:
	broadcast "%event-string% achieved!"
	delete holo object "%event-string%"	

This is meant to broadcast event string which is ID of hologram and delete that hologram. If you try this, the example above will make all hologram to have "username1_thrust" ID. However, only one is deleted by pickup event, and only broadcast event occurs when I just stand at that hologram. So basically they are actually not even created in same ID. I tried multiple times in many different ways but couldn't get this working. It works fine if I don't loop, but independently create hologram one by one.

aaa8881 avatar Jul 13 '17 08:07 aaa8881