![]() |
|
06-02-2012
|
1 |
|
Registered User
Join Date: Dec 2011
Location: Blacksburg, Virginia
Posts: 5,459
|
Script Help
I have a simple drag script and was wondering how to freeze the player being dragged through the air with freezeplayer2();. Any suggestions?
Last edited by The Doctor; 06-02-2012 at 12:28 AM.
Reason: Nevermind, new problem
|
|
06-02-2012
|
2 |
|
Registered User
Join Date: Apr 2016
Location: Testbed
Posts: 604
|
You could do it in a few ways. Set a variable like client.isfrozen which can be read client side and checked in a time out. If true, freeze otherwise don't. This variable could be used in other scripts as well. You would have to make sure you unset the variable when player logins in case they disconnect whilst being dragged. Another option is to trigger the player when they need to be frozen. This could be part of a weapon e.g. 'Movement' or 'System' or even in a class the player object has joined I.e. player.freezeplayer(int) which will trigger client side and then freeze the player. You would then have another option to unfreeze them. This way means no timeouts so less CPU time. |
|
06-02-2012
|
3 |
|
Registered User
Join Date: Dec 2011
Location: Blacksburg, Virginia
Posts: 5,459
|
Thank you (+rep). Also, I've removed opening a player's profile so I can add some player options to them. I want a drop down GUI to pop up next to the player when I right click them. Is there an if() statement to detect if someone right clicked their mouse on the player?
|
|
06-02-2012
|
4 |
|
Registered User
Join Date: Apr 2016
Location: Testbed
Posts: 604
|
Nothing like that. Instead, you can use findnearestplayer(float x, float y) in a function onMouseDown e.g. PHP Code:
Note: there won't be a limit on range. If you only want players within 5 tiles, you will either need to test distance using the returned obj(s) or custom function e.g. PHP Code:
|
|
06-02-2012
|
5 |
|
Registered User
Join Date: Dec 2011
Location: Blacksburg, Virginia
Posts: 5,459
|
That's all! Thank you.
|
|
06-05-2012
|
6 |
|
Registered User
Join Date: Dec 2011
Location: Blacksburg, Virginia
Posts: 5,459
|
New question. I have a small bar with NPCs in it. I only want staff to go through the npc door that warps you to the other level. So far, I have the tag Owner to be able to warp. It works, but I want it to work for all the staff specified in the server options. Here's what I have so far. I'm thinking it was an if() statement in there somewhere. PHP Code:
|
|
06-05-2012
|
7 | |
|
Registered User
Join Date: Apr 2016
Location: Testbed
Posts: 604
|
PHP Code:
|
|
|
06-05-2012
|
8 |
|
Registered User
Join Date: Dec 2011
Location: Blacksburg, Virginia
Posts: 5,459
|
You've been a great help ![]() I'll test it right away I tested it, didn't work. I think it's because instead of player.guild, it should be the player's community name/graal ID. |
|
06-05-2012
|
9 | |
|
The muffin man
Join Date: Sep 2011
Location: Burger Refuge
Posts: 2,262
|
|
|
|
06-05-2012
|
10 |
|
Registered User
Join Date: Dec 2011
Location: Blacksburg, Virginia
Posts: 5,459
|
It's a door? What abuse am I creating with a staff room? Thanks anyway. |
|
06-05-2012
|
11 |
|
The muffin man
Join Date: Sep 2011
Location: Burger Refuge
Posts: 2,262
|
|
|
06-05-2012
|
12 |
|
Registered User
Join Date: Dec 2011
Location: Blacksburg, Virginia
Posts: 5,459
|
|
|
06-05-2012
|
13 |
|
The muffin man
Join Date: Sep 2011
Location: Burger Refuge
Posts: 2,262
|
|
|
06-05-2012
|
14 |
|
Registered User
Join Date: Dec 2011
Location: Blacksburg, Virginia
Posts: 5,459
|
PHP Code:
|
|
06-05-2012
|
15 | |
|
Registered User
Join Date: Aug 2011
Location: En La Caja
Posts: 1,679
|
PHP Code:
PHP Code:
PHP Code:
|
|