Jump to content

Recommended Posts

So i need some help with some coding, I'm new to this.

 

I need a code where my character takes more damage

 

and

 

Also if there's a code for the water balloon where when throwing it and on impact causing damage in certain amount of area within where the impact landed?

 

 

Link to comment
https://forums.kleientertainment.com/forums/topic/56666-need-help-with-some-code/
Share on other sites

@ZombieTG:

	-- extra damage	-- master_postinit	local extra_multiplier = 1.25	local old_gta = inst.components.combat.GetAttacked	inst.components.combat.GetAttacked = function(self, attacker, damage, weapon, stimuli)		damage = damage and (damage * extra_multiplier)		return old_gta(self, attacker, damage, weapon, stimuli)	end
-- Waterballoon damage-- modmainAddPrefabPostInit("waterballoon", function(inst)	if GLOBAL.TheWorld.ismastersim then		local old_ohfn = inst.components.complexprojectile.onhitfn		local function NewOnHit(waterballoon, attacker, target)			local x, y, z = waterballoon.Transform:GetWorldPosition()			local radius = 5			local damage = 20			local ents = GLOBAL.TheSim:FindEntities(x, y, z, radius, nil, { "FX", "NOCLICK", "DECOR", "INLIMBO", "player", "playerghost" })			for i, v in ipairs(ents) do				if v.components.combat and not (v == inst) then					v.components.combat:GetAttacked(inst, damage)				end			end			old_ohfn(waterballoon, attacker, target)		end		inst.components.complexprojectile:SetOnHit(NewOnHit)	endend)

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