bassprinkes08 Posted May 27, 2018 Share Posted May 27, 2018 I want to make a custom character, with a perk that allows them to deal more damage and run faster while at low health. This is my first time modding so being elaborate with any instructions would really help, I am still not completely sure exactly where in the code for the custom perks would go, although i would assume they go somewhere in the character.lua file. Thanks for any help. Link to comment Share on other sites More sharing options...
bassprinkes08 Posted May 27, 2018 Author Share Posted May 27, 2018 I did some more research and found a thread with a similar problem, I followed what they were doing based on what I was after and got these lines of code. Sadly they didn't seem to achieve what i was after. If anyone knows how to fix it and what im doing wrong your help is greatly appreciated. local function heroking(inst) if (inst.components.health.current:GetPercent() > .2) then inst.components.locomotor.walkspeed = 6 inst.components.locomotor.runspeed = 8 inst.components.combat.damagemultiplier = 2 end end My goal is to double the damage and increase the speed of the character when at or below 20% health. Link to comment Share on other sites More sharing options...
. . . Posted May 27, 2018 Share Posted May 27, 2018 something like this should work YOURCHAR.lua above master_postinit Spoiler local function heroking(inst) if inst.components.health:GetPercent() <= .2 then --make char stronk elseif inst.components.health:GetPercent() >= .2 then --make char normal end end inside master_postinit Spoiler inst:DoPeriodicTask(2, heroking) Link to comment Share on other sites More sharing options...
bassprinkes08 Posted May 28, 2018 Author Share Posted May 28, 2018 It seems to be working now. Thank you so much for the help! Link to comment 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