ReikuChanz Posted May 4, 2015 Share Posted May 4, 2015 My friend can't figure out how to make a character do different damage at different times of the day, we tried using/editing abigail's code which didn't work at all. Can anyone help? Link to comment https://forums.kleientertainment.com/forums/topic/53521-how-to-make-a-character-do-moreless-damage-depending-on-time-of-day/ Share on other sites More sharing options...
DarkXero Posted May 4, 2015 Share Posted May 4, 2015 local function updatedamage(inst, phase) if phase == "day" then inst.components.combat.damagemultiplier = 1.5 elseif phase == "night" then inst.components.combat.damagemultiplier = 2.5 elseif phase == "dusk" then inst.components.combat.damagemultiplier = 1.8 endend-- in master_postinit(inst)inst:WatchWorldState("phase", updatedamage)updatedamage(inst, TheWorld.state.phase)Abigail's code changes default damage.Default damage is the damage you deal with your fists. Try using other stuff, like damagemultiplier. Link to comment https://forums.kleientertainment.com/forums/topic/53521-how-to-make-a-character-do-moreless-damage-depending-on-time-of-day/#findComment-634541 Share on other sites More sharing options...
ReikuChanz Posted May 5, 2015 Author Share Posted May 5, 2015 It worked! Thanks so much! Link to comment https://forums.kleientertainment.com/forums/topic/53521-how-to-make-a-character-do-moreless-damage-depending-on-time-of-day/#findComment-634583 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