Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, TipmyPip, OptimusPrime), 15,229 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Want to repeat function #156446
09/23/07 08:52
09/23/07 08:52
Joined: Aug 2006
Posts: 18
Australia
M
markman Offline OP
Newbie
markman  Offline OP
Newbie
M

Joined: Aug 2006
Posts: 18
Australia
Hi there. This is my script...what It does is is animate and on click of model talk. After it has run it wont work again. so if i click the model again it doesnt work. Any ideas what to do. thanks ^^


function talk_click2 () //script for my click on blacksmith guard on left of gate
{
my.event = null;//i put this line in so it could only be said once
if(event_type == event_click)
{
me= null;
wait(1);

snd_play (guard1, 100, 0);
}wait(1);
}


action click_talk2
{
my.enable_click = on;
my.event = talk_click2;
{ var counter = 0;
var c=0;
var anim_percentage = 0;

while (c<1000)
{ wait (1);
c+=1;
counter += time / 50; // add "1" to counter every second
anim_percentage += 8 * time;
ent_animate(my, "stand", anim_percentage, anm_cycle); // play the "stand" animation
}
}
}

Re: Want to repeat function [Re: markman] #156447
09/23/07 10:49
09/23/07 10:49
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline

Serious User
TWO  Offline

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Code:

function talk_click2()
{
var MySound = NULL;
my.event = NULL;

if(event_type == event_click)
{
MySound = snd_play(guard, 100, 0);
}

while(MySound!=NULL && snd_playing(MySound)) wait(1);

my.event = talk_click2;
}


action click_talk2()
{
my.enable_click = on;
my.event = talk_click2;

var anim_percentage = 0;

while(1)
{
anim_percentage += 8 * time;
anim_percentage %= 100;

ent_animate(my, "stand", anim_percentage, anm_cycle);

wait(1);
}
}



BTW this is no Lite-C code.

Re: Want to repeat function [Re: TWO] #156448
09/23/07 13:39
09/23/07 13:39
Joined: Aug 2006
Posts: 18
Australia
M
markman Offline OP
Newbie
markman  Offline OP
Newbie
M

Joined: Aug 2006
Posts: 18
Australia
thankyou so much ^^ and sorry for posting in the wrong section. I am new.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1