Jump to content

Recommended Posts

1 hour ago, zUsername said:

Are you sure you want to decrease damage every time clock ticks? Because in DST clock tick running in milisecond. So in 1 second you will lose 1 point.

I was just using it as an example. Its basicly over time you grow strong and over time you grow weak

You can use an idea provide by Muche or you can take a look with this code.
Every second if day time it's will decrease your damage by 0.1 and in dusk and night time it's will increase your damage by 0.1.
 

	inst:DoPeriodicTask( 1 , function()      
		if TheWorld.state.isday then
			inst.components.combat.damagebonus = (inst.components.combat.damagebonus or 0) - 0.1
		else
			inst.components.combat.damagebonus = (inst.components.combat.damagebonus or 0) + 0.1
		end
	end)

 

Edited by zUsername

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...