![]() |
Staff/SetAni
this script isn't working at all for me. I'm trying to make it so it sets animations for example : /ani PB_Gun21-Idle.gani
but its not working. Any help? PHP Code:
|
From what i have read online, these functions exist:
setani(str aniname, str aniparams) //Sets the gani of a player. replaceani(str defaultaniname, str newaniname) //replaces the player's default ani with the new ani. What you ofcourse can try to do, to narrow down your problem, is to use debugging logs with: echo(tokens); Note: i haven't scripted for this game in a while, hope you figure it out. |
- What you want to do is: just set a random gani (probably to check if it's alright?)
- What your script does (or what the main goal from the original source was): replace certain ganis (idle, walk, grab, ...) for a (most likely) custom movement Considering you stuck with the default movement and just want the animation to be seen on your player and not have it replace any other ganis (walk, grab, ...) you would first need to trigger the function. You probably want it to be done via the chat, so there are two options you've got: 1. Using onPlayerChats() and player.chat 2. Using ChatBar.onAction() and ChatBar.text An example with the first option (which is the most common) would look like this: PHP Code:
Next thing you might want to do is to check if your player is saying a command. That could be done like PHP Code:
So now, you might want to pull the file name of your gani out of your players chat (example: '/ani walkslow.gani'). This means, we still need to check the players chat BUT ignore the '/ani ' part. To do so, you could use the substring() function. It works like this: PHP Code:
Quote:
PHP Code:
PHP Code:
Now you can go ahead, play around with those examples and put together the script. I didn't post the full script on purpose. If you want to add scripts, you should understand what you're doing ;) |
All times are GMT +2. The time now is 09:03 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.