![]() |
grab
Whats the function for grabbing the npc?
ive tryed making my own but its in-acurate x.x |
Umm, when the NPC is grabbed?
I don't think there is one. |
Quote:
then how might u go about doing that? |
There is onActionpushed/pulled, but no grabbed.
You do so by simply performing a triggeraction on keydown(6). PHP Code:
PHP Code:
|
Quote:
|
If you keep your finger on the key for a second it'll start spamming the action though o.O
I've always wondered how bad it can be to spam triggeraction like that, i know it can be done on some servers since they use the onKeyPressed event, but wouldn't it eventualy start lagging if 5 players decided to grab a wall at the same time for a couple minutes? |
Quote:
If the 5 players grabbed some fancy objects that did all crap like loading files, requestiing urls and **** it could lag if there was enough players.. But there is always lag, you just don't notice it :p |
Well that's easy to stop:
PHP Code:
|
Quote:
(PS: this. instead of temp.) |
Well, the problem is onKeypressed will repeat while the button is held down(much like holding a key down like thissssssssss), so it won't only be called once. That script makes it so it will only work when the key is first pressed, and won't work until it's released.
|
Quote:
as if when you hold down the key, it will trigger the event on new, and on new etc.. all the time, thus in clearing the temp. variables |
Ya, that'll need to be changed to this. instead of temp.
|
the easiest solution is still to add the grab detection inside your custom movement system's timeout >=o!
I never liked working with the onKeypressed event for graal... Doesn't really make sense to me that the event is triggered over and over again as long as the key is held down x-x |
Well first, that requires them to have a custom movement, this assumes they don't.
Second, Graal has no control over the repeated sending of onKeypressed. This is something with keyboards, as long as the key is held down, it'll repeatedly send the key bring pressed. Graal simply grabs that information, it can't stop it from repeating the key. |
Quote:
|
| All times are GMT +2. The time now is 12:01 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.