![]() |
mouseX and mouseY help
If i had a 16x16Pixle image (1 Graal tile square) NPC that size too loacated at X=32 and Y=32 how would I make it so that if it was ANYWHERE on the NPC it would:
message test; I want it to cover the whole NPC which I dont know how to do anyone know how to make it see if the mouse is ANYWHERE on the NPC thats 16x16pixles? Thanks in advanced to those who may help, If i dont get a chance to thank you later. |
if (mousex==32&&mousey==32) {
message test; }else { message ; } |
That didnt work!? =( :(
|
hah! Look i did it by my self (Thats good for me!)
NPC Code: |
Since people want to speak ill'y of peoples coding styles, THIS was horrible x.X
NPC Code: Original code by Shifter XP. And unlike yours, which will ONLY do it if it is at that certain X and Y, mine will do it regardless of where really. 0.05 timeout... he he, I really don't use it anymore. 0.1 laggs a bit w/ an NPC Server, but 0.25 still does it enough times a second where it makes no differece :) ---Shifter |
.. you could have used testnpc too
something like: NPC Code: or you could use == instead if you want it to relate to the npc with that index |
Quote:
Im only learning, I dont understand ''For'' nor do I undestand ''i=0'' nor do I understand ''abs''! =( |
mathematical i cant do that 2 X.x
i hate that i also cant use test things and that sux :( can some1 explain us our just meh ? :) |
omg! Here is a QUICK explanation of the for command
for consists of THREE parts: i=0; is generally the first. i is a variable, it can be about any letter. 0 is set to the starting point. you could do i=100 and 100 would be the starting point. 2nd Part) i<allplayerscount; is a generally used one. it says that it will continue if i<allplayerscount 3rd Part) i ++ it means that if the 2nd part is still true, it makes i go up one. I is basically a variable. so here is an example: NPC Code: it starts at i=1 (0 is the current player, so it does it for EVERYONE but the current player) then it will add 1 to i until i equals the playerscount (playerscount = players in THAT level, allplayers is the entire server) so then it would set every player except the one who started the reaction, to 30 30. ---Shifter |
LOL, Kai, true, for is not a COMMAND. It is a technicality =P But regardless, I know how to use it XD
---Shifter |
RAWR, don't make it so complex X.x
NPC Code: |
x.X You don't get it at ALL do you screen_name? That is a HORIBLE way to do it x.X You are again, SPECIFYING the location of it, the way I did it was:
1) In NO way complex, simple for command x.X if you think that is complex, you'd have a heartache seeing some of my scripts =P 2) If you have your mouse in location to the NPC, rather than in location of the level, which works MUCH better, and you can move the NPC around w/o recoding. Kai: Yes, I know how to use it ;) Technicalities matter little, if you can use it properly and not get errors is what counts :) I have a feeling Kai would agree more w/ my explanation of how to do this ---Shifter |
Quote:
in either case, just change the first 32's in my script to x and the second set of 32's to y |
I understand screen_names more then ''abs'' but sort of understand ''abs'' so thanks to all of you. And no need to argue about it please, I only needed help not World war 3
|
abs() = absolute value of whats in the ()
they never really answered you so i did :D I learnt that from mah calculator coding o.O |
| All times are GMT +2. The time now is 12:38 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.