Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-23-2009, 12:19 AM
Jman9912 Jman9912 is offline
Registered User
Join Date: Jun 2001
Location: North Carolina
Posts: 114
Jman9912 is on a distinguished road
Send a message via AIM to Jman9912
Day/Night system

I'm working on a basic day night system for practice. Here is what I have so far as it is really basic. Still adapting to GS2. I was wondering if anyone could give me any suggestions and help me improve on it.

NPC Code:

//#CLIENTSIDE
function onCreated() {
client.time=0;
Initialize();
}

function Initialize() {
for (client.time == 0;client.time <= 23;client.time++) {
if (client.time >= 0 && client.time<2) {
seteffect 0,0,0,.7;
}

if (client.time >=3 && client.time <= 5) {
seteffect 0,0,0,.5
}

if (client.time >= 6 && client.time <=8) {
seteffect 0,0,0,.3;
}

if (client.time >=9 && client.time <=12) {
seteffect 0,0,0,.1;
}

if (client.time >=13 && client.time <=17) {
seteffect 0,0,0,0;
}

if (client.time >=18 && client.time <=21) {
seteffect 0,0,0,.3;
}

if (client.time >=22 && client.time <=24) {
seteffect 0,0,0,.5;
}

sleep(2);

if (client.time==24) {
client.time = 0;
}
echo(client.time);
showtext(128,50,150,$pref::graal::defaultfontname, "bc","Time: " @ client.time @ ":00");
changeimgvis 128,4;
}
}

Reply With Quote
 


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 05:39 PM.


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