Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   twinkling lamp (https://forums.graalonline.com/forums/showthread.php?t=134257056)

OiRodgar 11-24-2009 09:52 PM

twinkling lamp
 
Hello! I got a problem. I'm trying to script a twinkling lamp. But somehow it doesn't work.

PHP Code:

// NPC made by OiRodgar
//#CLIENTSIDE
function onCreated() {
showimg(200,"light4.png",x-3.1,y-3);
changeimgcolors(200,1,0.5,0.1,0.5);
changeimgzoom(200,2);
changeimgvis(200,3);
setTimer=(0.1);
}

function 
onTimeout() {
changeimgcolors(200,1,.5,.1,random(.5,.4));
setTimer=(0.1);


The timeout should change the colour of the light.

DustyPorViva 11-24-2009 10:01 PM

setTimer is a function, not a variable: setTimer(0.1).

Also, you can just use findimg(200).alpha = random(.4,.5); as the alpha is the only thing being changed(also, you had it backwards, min first, max second). You might also want to change the zoom.


All times are GMT +2. The time now is 12:40 PM.

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