![]() |
OnPlayerTouchsMe Problem
PHP Code:
But what if the NPC moves instead and touchs the player? Is there a function for that? |
You could always check the NPCs x/y and if its in the players x/y within a loop or in whatever you need that
PHP Code:
|
Graal really needs an onCollide() function.
|
Quote:
|
Quote:
|
Quote:
PHP Code:
PHP Code:
So try this PHP Code:
|
If you're moving the npc on the server-side you need to use findnearestplayers or some other kind of loop and a bounds check like callimuc has posted. I.e.
PHP Code:
|
Quote:
The script wakes up my npc. But the NPC doesn't know who to follow once woken up. here is what I got PHP Code:
|
Quote:
PHP Code:
|
PHP Code:
Alternatively this can be done: PHP Code:
|
This is all great information but my last reply post never got answered :/
|
Quote:
Uploaded this npc in a level I was in: PHP Code:
PHP Code:
PHP Code:
|
I think something like this would be a more appropriate way to check for collisions, albeit there's more calculation going on:
PHP Code:
However I threw this up in notepad and didn't test it myself. Your mileage may vary. |
Quote:
|
Oh ok, thanks at dusty and fp
Quote:
PHP Code:
|
Quote:
What can you do to store information? What can you do to check the status of said stored information before proceeding to do other things? If you find a player then store the player's account/object as the NPCs current interest. If the NPC has an interest then proceed to track ONLY that player. If it has no interest then LOOK for a new player to hunt down(with findnearestplayer). |
| All times are GMT +2. The time now is 05:09 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.