Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Shop Script Help (https://forums.graalonline.com/forums/showthread.php?t=81742)

GULTHEX 09-10-2008 04:20 AM

Shop Script Help
 
PHP Code:

if (playerchats && strequals(#c,buy Hug) && playerrupees >=5)
{
playerrupees-=5;
addweapon Event/Hug;


when i click test in level maker it says this

Error: Unknown command: addweapon Event/Hug
how do i fix or is there a substitute for addweapon???

LoneAngelIbesu 09-10-2008 04:33 AM

In offline playerworlds, you should use toweapons Event/Hug. It's possible that the level editor doesn't recognize the addweapon command. Just see if it works online.

GULTHEX 09-10-2008 04:41 AM

it dont work online thats the prob :(

Demisis_P2P 09-10-2008 05:39 AM

You should probably get into the habit of not doing multiple checks on the same line unless they're directly related.

+ try addweapon ("Event/Hug");
It might even be case sensitive, I'm not sure.

Inverness 09-10-2008 06:01 AM

Quote:

Originally Posted by Demisis_P2P (Post 1421919)
You should probably get into the habit of not doing multiple checks on the same line unless they're directly related.

+ try addweapon ("Event/Hug");
It might even be case sensitive, I'm not sure.

No. That is GS2, GS2 doesn't work offline.

addweapon does not exist offline.

If you're going to test it online then ignore what the level maker says.

I see no reason why that script wouldn't work online on the serverside.

Demisis_P2P 09-10-2008 06:03 AM

Quote:

Originally Posted by inverness (Post 1421923)
no. That is gs2, gs2 doesn't work offline.

Addweapon does not exist offline.

If you're going to test it online then ignore what the level maker says.

Quote:

Originally Posted by gulthex (Post 1421913)
it dont work online thats the prob :(

^ ^ ^

Inverness 09-10-2008 06:05 AM

Quote:

Originally Posted by Demisis_P2P (Post 1421924)
^ ^ ^

The script is fine, he either didn't test it online even though he said he did or hes doing something wrong elsewhere.

GULTHEX 09-10-2008 03:48 PM

Lol it dont work at all online

Crono1508 09-10-2008 05:02 PM

Does the NPC even exist in the NC?

xXziroXx 09-10-2008 05:04 PM

Quote:

Originally Posted by GULTHEX (Post 1422002)
Lol it dont work at all online

playerchats doesn't work serversided in a weapon NPC, fyi.

GULTHEX 09-10-2008 05:53 PM

how do i put it in nc???

Frankie 09-11-2008 01:58 AM

there's really no point putting that in NC. just keep it in a level based NPC.

[email protected] 08-02-2009 09:30 PM

player.addWeapon("WEAPONNAMEHERE");

Only works serverside so make a case and do a triggerserver.

Crow 08-02-2009 10:45 PM

Quote:

Originally Posted by [email protected] (Post 1512571)
player.addWeapon("WEAPONNAMEHERE");

Only works serverside so make a case and do a triggerserver.

His whole script is serverside. No point in making it clientside, eh?

Anyway, first off, make sure you got the script you posted somewhere in a level npc, not inside a weapon. Also, make sure that the weapon "Event/Hug" actually exists and has got at least a tiny bit of code which fires when the weapon is added, so you know buying it actually worked. If both apply, everything should work fine. If not, you are probably still doing something wrong. Maybe write a more detailed description for us? Or even provide the code of the weapon, might help. All up to you.

Gambet 08-02-2009 11:22 PM

I take it you guys didn't realize this thread is quite old? :o

papajchris 08-02-2009 11:34 PM

Quote:

Originally Posted by Gambet (Post 1512591)
I take it you guys didn't realize this thread is quite old? :o

Pwnt

Crow 08-02-2009 11:46 PM

Quote:

Originally Posted by Gambet (Post 1512591)
I take it you guys didn't realize this thread is quite old? :o

Now you mention it :oo: I never really pay attention to dates, I just pick my threads from the forums main page..

Twinny 08-03-2009 01:18 AM

I scroll up to the top by habit and that does involve checking the date :)

Pelikano 08-03-2009 01:13 PM

Quote:

Originally Posted by Twinny (Post 1512614)
I scroll up to the top by habit and that does involve checking the date :)

It was at the top already when Crow posted ;)

Crow 08-03-2009 01:33 PM

Quote:

Originally Posted by Pelikano (Post 1512700)
It was at the top already when Crow posted ;)

He's talking about the top of the thread I guess :oo:

Pelikano 08-03-2009 01:35 PM

Oh I see


All times are GMT +2. The time now is 06:17 AM.

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