![]() |
Player on Npc
I've tried a variety of different ways, but they all seem inconsistent so I'll just show and ask. I'm trying to detect the player on an npc, which really seems easy enough but for some reason acts very strange with this code.
PHP Code:
What it actually does is, sometimes it checks for the player. My Timer is set at .1 so that's not the problem. Also i've played with the plus and minus from the this.x and this.y, but it just seems that it doesn't always catch the player on top of the npc which would be these coordinates. Any suggestions would be awesome. |
I assume there is a reason you would like to use a timeout in your code for this.
This should determine when the player is within the circle with a radius of 1 tile: PHP Code:
PHP Code:
PHP Code:
|
Slight side note but you can specify ranges rather than using multiple && e.g.
PHP Code:
|
Ok so this is what I'm trying to accomplish with the player coordinate checks.
Its a ladder and I'm using a custom movement system. I need to place an enable and disable custom movement but I haven't yet. This script seems to work fine if I come top down, but if I start at the bottom it doesn't work at all. Any help is appreciated. PHP Code:
|
bump... still need help...
|
use disabledefmovement and attackplayertoobj. There was a ladder help script a few weeks ago, use the forum search function.
|
Try something like this:
- Check if the player touched the ladder - If touched, "attach" the player to ladder - Disable the player's normal movement - While "attached" make sure the player is still on the ladder and check for keystrokes, move the player if necessary. PHP Code:
|
Quote:
Thanks MrOmega Just seems when I use the player coordinates it doesn't function correctly. I tried this, and it's the same thing I was trying to accomplish just better, but it still doesn't seem to work. I guess I need to attachplayertoobj after all? Thanks anyway fp4! |
| All times are GMT +2. The time now is 05:18 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.