Set Gani Script

This is a simple script I’m making which allows you to do a gani by saying a simple fraise…

if (created || playerenters) {
toweapons -GanisSet;
if (playerchats && strequals(#c,:sit:)){
setani sit,;
if (playerchats && strequals(#c,:cry:)){
setani cry,;
if (playerchats && strequals(#c,:dance:)){
setani dance,;

you should shorten it. Do something like:

if (playerenters || created)toweapons -GaniSet;
if (playerchats && startswith(:,#c))setani #e(1,strlen(#c)-1,#c),;

I havent tested it and this uses some commands Ive never used before but yer this shud give you a good idea of how to make your system more flexible and easier to add to.

Thanks for the help Tricxta!
I made a bigger script for my server.
It doesn’t allow people to use ganis they shouldn’t have yet

if (playerenters || created)toweapons -GaniSet;{
  if (playerchats && strequals(#c,:cry))
    setani icry,;
  if (playerchats && strequals(#c,:sit))
    setani sit,;
  if (playerchats && strequals(#c,:dance))
    setani ce_dance1,;
  if (playerchats && strequals(#c,:run))
    setani walk,;
  if (playerchats && strequals(#c,:walk))
    setani walkslow,;
  if (playerchats && strequals(#c,:die))
    setani suicide1,;
  if (playerchats && strequals(#c,:pray))
    setani pray,;
  if (playerchats && strequals(#c,:whistle))
    setani whistle,;
  if (playerchats && strequals(#c,:grab))
    setani grab,;

No it doesn’t…

I love how tricxta taught him how to shorten it so then he made it longer…

uhhh I dont like that big bulky script of yours so I modified mine to use an array so you can easily add to it, you can gift ganis through rc or sell them in shops :slight_smile:

if (playerenters || created && !isweapon){
  toweapons -GaniSet;
  addstring ganisallowed,cry;//duplicate this line for the ganis you want to allow
if (playerchats && !lindexof(ganisallowed,#e(1,strlen(#c)-1,#c))=  && startswith(:,#c))setani #e(1,strlen(#c)-1,#c),;

once again its not tested but here you are anyway…

Careful with your example tricxta, you’ll end up with an gradual infinite loop on that addstring ganisallowed,cry.
You’ll end up with “cry,cry,cry,cry,cry”

Just use setstring ganisallowed,cry,sit,die; or stick setstring ganisallowed,; before all of the addstrings.

limit the gani’s allowed to be played ya

ya dont want a bunch of noobs idling in the 3so gani…

I lol’d

they stole cry gani from zod and renamed icry :stuck_out_tongue:

I’ve seen a few crying ganis, so who knows!

are you meaning to say !lindexof(ganisallowed,#e(1,strlen(#c)-1,#c))= doesnt work in the code? and soz I didnt reply earlier I’ve been away