[Request]Testing for a player holding a specific NPC?

Description: Have idea for a script, but you can't make it? Post it here!
Moderators: Yoshi021, Lx Xzit, 5438A38A, Semi-moderatos, Moderators

Dry Bones M
Topic author, Good citizen
Good citizen
Avatar
Dry Bones M
Topic author, Good citizen
Good citizen
Age: 18
Reputation: 18
Posts: 25
Joined: 1 Jul 2017
Location: Germany

Post #1by Dry Bones » 30 Jul 2019, 13:36

Is there a way to test, if a Player is holding a specific NPC (e.g. Mushroom Block)? I'm aware of the "Grab" event flag, but that one doesen't test for the player who holds the npc (or if both players hold the type of NPC) and doesn't apply globally to the NPC type.
Thanks in Advance.
"Reality is merely an illusion, albeit a very persistent one." - Albert Einstein


My largest Project (to get a better view of the image, click on it (it's too large to be inserted here)):
Spoiler
Image


#RemasterThousandYearDoor

Lx Xzit M
Moderator
Moderator
Avatar
Lx Xzit M
Moderator
Moderator
Reputation: 258
Posts: 595
Joined: 9 Nov 2015
Website

Post #2by Lx Xzit » 30 Jul 2019, 14:58

This returns the ID of the NPC being held. The only problem is that it lacks of P2 support, so you need to duplicate the code and replacing "char(1)" with "char(2)", as well as creating new variables (except for iterator variables, you don't need new variables for that):
Attachments
Grab-detector.lvl
(4.03 KiB) Downloaded 12 times
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

Dry Bones M
Topic author, Good citizen
Good citizen
Avatar
Dry Bones M
Topic author, Good citizen
Good citizen
Age: 18
Reputation: 18
Posts: 25
Joined: 1 Jul 2017
Location: Germany

Post #3by Dry Bones » 5 Aug 2019, 20:44

Lx Xzit wrote:This returns the ID of the NPC being held. The only problem is that it lacks of P2 support, so you need to duplicate the code and replacing "char(1)" with "char(2)", as well as creating new variables (except for iterator variables, you don't need new variables for that):
Thanks, this should work for my script. (Sorry for responding so late.)
"Reality is merely an illusion, albeit a very persistent one." - Albert Einstein


My largest Project (to get a better view of the image, click on it (it's too large to be inserted here)):
Spoiler
Image


#RemasterThousandYearDoor


Return to “Script requests”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest