how to reference a mob?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

pepper82

Member
Jan 26, 2017
272
1
18
I want to set a targeted entities walk speed to zero and set it back to default a few seconds later but it does not work:


command /test:
trigger:
set {_t} to targeted entity
set walking speed of {_t} to 0
wait 3 seconds
set walking speed of {_t} to 1

Does not work. The entity's speed is set to 0 but not set back to 1 after few seconds. So how would I reference the entity correctly?
 
I want to set a targeted entities walk speed to zero and set it back to default a few seconds later but it does not work:


command /test:
trigger:
set {_t} to targeted entity
set walking speed of {_t} to 0
wait 3 seconds
set walking speed of {_t} to 1

Does not work. The entity's speed is set to 0 but not set back to 1 after few seconds. So how would I reference the entity correctly?
I don't know, but I do know that the default speed for walking is 0.2, so I would recommend changing that unless you want your mob to go five times as fast as normal. Go here for more information: http://skunity.com/search?search=speed#Speed
 
Player walking speed is 0.2. It's different for other mobs (ocelots walk faster than players, zombies walk slightly slower, etc)
 
Player walking speed is 0.2. It's different for other mobs (ocelots walk faster than players, zombies walk slightly slower, etc)
@pepper82 A good solution for that would be to get the mob's speed before you set it to 0, then set the mob's speed to whatever it was before you set it.
[doublepost=1497825683,1497825105][/doublepost]@pepper82 I tested your code, it doesn't set the speed of the entity to 0 nor set it back to 1
EDIT: Did a little more testing, your code does everything correctly except setting the speed. I don't think you can set an entity's speed
[doublepost=1497826876][/doublepost]@pepper82 You can also apply slowness 9999 to them for 3 secs
EDIT: Lol sorry for all the double posts and edits
 
Last edited by a moderator:
  • Like
Reactions: pepper82
Status
Not open for further replies.