Page 1 of 1

LUA scrpting

Posted: Wed Aug 29, 2012 8:35 am
by Streich3r
hey gemetoastteam :D


i wanted scripting a pointregion with a timer.

ok,i think no problem and done it..



OnEnterRegion(
function(region,player)
CreateTimer("PT")
SetTimerValue("PT",15)
ShowTimer("PT")
StartTimer("PT")
OnTimerElapse(
function( timer )
AddAssaultDestroyPoints(character)
SetTimerValue( "PT", 15 )
ShowTimer( "PT" )
StartTimer( "PT" )

end, "PT"
)
end,
"Hill"
)





OK works.. But not so, as I thought..


my idea how it should work
If a player enters this region, a timer should start and count until zero. And get a point to these player, which are staying there.
And player who's left the region shouldn't get a point.
And my Scrptingpart works such that if a player enters region and the timer is on 0, then all players get a point and if a player get out of the region and after that he enters it again.
All players will then get as many points as many times the one player enters the region.... it doesn't reset.