Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GUI script works in v6 but not v5? (https://forums.graalonline.com/forums/showthread.php?t=134262526)

skillmaster19 03-25-2011 02:26 AM

GUI script works in v6 but not v5?
 
I made a GUI script that sets the players gani if they click a button, and to my suprise the buttons work in v6 but not v5. Can anyone explain why/ how to fix it? here is the code:




NPC Code:

// Scripted by skill
//#CLIENTSIDE
function onWeaponFired() {
gestureswindow.show();
new GuiWindowCtrl("gestureswindow")
{
profile = GuiBlueWindowProfile;
extent = {310,500};
position = {5, 5};
text = "Gestures";

new GuiButtonCtrl("gesturegrab")
{
profile = GuiBlueButtonProfile;
extent = {100, 25};
position = {105,25};
text = "grab";
}
new GuiButtonCtrl("gesturewalk")
{
profile = GuiBlueButtonProfile;
extent = {100, 25};
position = {5,25};
text = "walk";
}
new GuiButtonCtrl("gesturesit")
{
profile = GuiBlueButtonProfile;
extent = {100, 25};
position = {205,25};
text = "sit";
}
}
}
function gesturegrab.onAction()
{
player.ani = "grab";
}
function gesturewalk.onAction()
{
player.ani= "walk";
}
function gesturesit.onAction()
{
player.ani= "sit";
}


Twinny 03-25-2011 02:39 AM

For future posts, try wrapping your code in PHP tags so it doesn't get so stretched and unreadable.

Anyhoo, it might be that player.ani isn't V5 friendly. I've always used TServerPlayer.setani(str, str) which should work fine in these instances

e.g.

PHP Code:

  player.setani("walk",""); 


skillmaster19 03-25-2011 02:44 AM

Quote:

Originally Posted by Twinny (Post 1638707)
For future posts, try wrapping your code in PHP tags so it doesn't get so stretched and unreadable.

Anyhoo, it might be that player.ani isn't V5 friendly. I've always used TServerPlayer.setani(str, str) which should work fine in these instances

e.g.

PHP Code:

  player.setani("walk",""); 


for some reason player.setani("walk",""); doesn't work at all.

fowlplay4 03-25-2011 03:00 AM

Quote:

Originally Posted by skillmaster19 (Post 1638708)
for some reason player.setani("walk",""); doesn't work at all.

Do just setani.

skillmaster19 03-25-2011 03:21 AM

Thank you Fowlplay, it works!


All times are GMT +2. The time now is 11:19 PM.

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