Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-25-2011, 02:26 AM
skillmaster19 skillmaster19 is offline
Registered User
Join Date: Oct 2010
Posts: 392
skillmaster19 will become famous soon enough
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";
}

Reply With Quote
  #2  
Old 03-25-2011, 02:39 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
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",""); 
Reply With Quote
  #3  
Old 03-25-2011, 02:44 AM
skillmaster19 skillmaster19 is offline
Registered User
Join Date: Oct 2010
Posts: 392
skillmaster19 will become famous soon enough
Quote:
Originally Posted by Twinny View Post
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.
Reply With Quote
  #4  
Old 03-25-2011, 03:00 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by skillmaster19 View Post
for some reason player.setani("walk",""); doesn't work at all.
Do just setani.
__________________
Quote:
Reply With Quote
  #5  
Old 03-25-2011, 03:21 AM
skillmaster19 skillmaster19 is offline
Registered User
Join Date: Oct 2010
Posts: 392
skillmaster19 will become famous soon enough
Thank you Fowlplay, it works!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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