Jump to content

Recommended Posts

Hey there, I'm trying to make a character that is immune to freezing but to make it somewhat fair I want him to lose a lot of speed so there is still a reason to stay warm during the winter. But due to my knowledge in coding I don't know how to form the part needed for this to happen. I've tried to guess what strings I need and what not and its resulted in:
 

local function updatestatus(inst)	if TheWorld.state.temperature > 0 then		inst.components.health:SetMaxHealth(200)		inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.5)		inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.5)	else		inst.components.health:SetMaxHealth(100)		inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 0.7)		inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 0.7)endend

 
I do not receive a crash or any error, it's just not working. So is there anything that is wrong? I'm guessing its the if statement but I have no idea as to what I would put in place of "TheWorld.state.temperature". The health difference is there just to help see if the code is working quicker than what it would be to wait for it to become cold.

Thanks for any advice,
Joshseven

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...