Jump to content

Character Mod Help!!!


Recommended Posts

 

How can I do this so that damage increases my character every time it comes down to the maximum amount of life ???
I'm Russian, we unfortunately do not have this popular game, and mods and even less do. Do not swear strongly, I use an interpreter

 

 

I want to add my character The less damage he has, the more he attacks

 

 

 

 

local function VI(inst)
 
    if inst.components.health.maxhealth <= (75) then
       inst.components.combat.damagemultiplier = (99999999)
    end
 end
    
    
    
local function onload(inst)
    inst:ListenForEvent("Я пришёл,что бы научить тебя", onbecamehuman)
    inst:ListenForEvent("ms_becameghost", onbecameghost)

    if inst:HasTag("playerghost") then
        onbecameghost(inst)
    else
        onbecamehuman(inst)
    end
end

local common_postinit = function(inst) 
    
    inst.MiniMapEntity:SetIcon( "kama.tex" )
end

local function uraken(inst)

     if inst.components.sanity.current <= (20) then 
     
     inst.components.combat.damagemultiplier = 10.0 
     inst.components.health:StartRegen(5, 20)
     end

end
 
 

 
local master_postinit = function(inst)
    
    inst.soundsname = "willow"
    
    
    inst.components.health:SetMaxHealth(100)
    inst.components.hunger:SetMax(75)
    inst.components.sanity:SetMax(50)
    inst.components.sanity.night_drain_mult = (0.50)
    inst.components.combat.damagemultiplier = 1
    inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE
    inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.1)
    inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.1)
    
    
    
    inst:ListenForEvent("healthdelta", function(inst) VI(inst) end)
    inst:ListenForEvent("sanitydelta", function(inst) uraken(inst) end)
    inst:ListenForEvent("killed", function(inst) levelup(inst) end)
        
    inst.OnLoad = onload
    inst.OnNewSpawn = onload
    
end

return MakePlayerCharacter("kama", prefabs, assets, common_postinit, master_postinit, start_inv)
 

Edited by Vull
Link to comment
Share on other sites

I think this should work for you :D!

inst:ListenForEvent("healthdelta", function(inst, data)
	if inst.components.health.currenthealth <= 75 then
		inst.components.combat.damagemultiplier = (99999999)
	end
end)

 

Link to comment
Share on other sites

28 minutes ago, SuperDavid said:

I think this should work for you :D!


inst:ListenForEvent("healthdelta", function(inst, data)
	if inst.components.health.currenthealth <= 75 then
		inst.components.combat.damagemultiplier = (99999999)
	end
end)

 

inst:ListenForEvent("healthdelta", function(inst, data)

insert into local master_postinit = function(inst)??

Link to comment
Share on other sites

43 minutes ago, SuperDavid said:

Put this inside YOURCHARACTER.lua is master_postinit and when he have fewer lives than 75 more damage he does

 

 

like this?

 

local master_postinit = function(inst)

    inst:ListenForEvent("healthdelta", function(inst, data)
    if inst.components.health.currenthealth <= 75 then
        inst.components.combat.damagemultiplier = (99999999)
    end
    end
    inst.soundsname = "willow"
    
    
    inst.components.health:SetMaxHealth(100)
    inst.components.hunger:SetMax(75)
    inst.components.sanity:SetMax(50)
    inst.components.sanity.night_drain_mult = (0.50)
    inst.components.combat.damagemultiplier = 1
    inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE
    inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.1)
    inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.1)
    
    
    
    inst:ListenForEvent("killed", function(inst) levelup(inst) end)
    
    inst.OnLoad = onload
    inst.OnNewSpawn = onload
    
end

Link to comment
Share on other sites

5 minutes ago, Lumina said:

You forgot the final )

 


inst:ListenForEvent("healthdelta", function(inst, data)
	if inst.components.health.currenthealth <= 75 then
		inst.components.combat.damagemultiplier = (99999999)
	end
end)
Thanks, it worked

))) Thanks

 

Link to comment
Share on other sites

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
 Share

×
  • Create New...