Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   ;[ (https://forums.graalonline.com/forums/showthread.php?t=12684)

Merlin 09-23-2001 09:10 PM

;[
 
what is wrong with this i replaced the actions with actions here;
but i don't know why it's not triggering,

// NPC made by Merlin
if (playerenters) {
timeout = .5;
}
if (timeout) {
getxy();
dance();
timeout = .5;
}

function getxy() {
client.x = playerx;
client.y = playery;
timeout = .5;
}
function dance() {
if (client.x > 20) {
if (client.x < 32) {
if (client.y > 7) {
if (client.y < 17) {
actions here;
}
}
}
}
}

KJS 09-23-2001 09:37 PM

Re: ;[
 
Quote:

Originally posted by Merlin
what is wrong with this i replaced the actions with actions here;
but i don't know why it's not triggering,

// NPC made by Merlin
if (playerenters) {
timeout = .5;
}
if (timeout) {
getxy();
dance();
timeout = .5;
}

function getxy() {
client.x = playerx;
client.y = playery;
timeout = .5;
}
function dance() {
if (client.x > 20) {
if (client.x < 32) {
if (client.y > 7) {
if (client.y < 17) {
actions here;
}
}
}
}
}

I am not totally sure what you want in the action here or whatever... But I fixed up the coding so it is a little more readable and understandable
NPC Code:

// NPC made by Merlin
if (playerenters)
timeout = .5;
if (timeout) {
dance();
timeout = .5;
}
function dance() {
if (playerx>20&&playerx<32&&playery>7&&playeryy<17){
actions here;
}
}


Merlin 09-23-2001 09:48 PM

Thanks


All times are GMT +2. The time now is 04:42 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.