Josh seven Posted May 16, 2015 Share Posted May 16, 2015 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 Link to comment https://forums.kleientertainment.com/forums/topic/54049-help-speed-related-to-temperature/ Share on other sites More sharing options...
Kzisor Posted May 16, 2015 Share Posted May 16, 2015 http://forums.kleientertainment.com/topic/53705-coding-run-speed-for-hotcold-also-reaching-out-to-another-modder/ Link to comment https://forums.kleientertainment.com/forums/topic/54049-help-speed-related-to-temperature/#findComment-638057 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now