Sign in to follow this  
NyctoDarkMatter

Help w/ Absorbant Character

Recommended Posts

DarkXero    2892

In Zoidberg's prefab:

local function RainBuff(inst)	inst.components.health:StartRegen(1, 2)	inst.components.sanity.custom_rate_fn = function(inst)		return TUNING.DAPPERNESS_LARGE	endendlocal function Normal(inst)	inst.components.health:StopRegen()	inst.components.sanity.custom_rate_fn = nilendlocal function onbecamezoidberg(inst)	if TheWorld.state.israining then		RainBuff(inst)	end	inst:WatchWorldState("startrain", RainBuff)	inst:WatchWorldState("stoprain", Normal)endlocal function onbecameghost(inst)	Normal(inst)	inst:StopWatchingWorldState("startrain", RainBuff)	inst:StopWatchingWorldState("stoprain", Normal)end-- Your central functionlocal function master_postinit(inst)	-- Other code of yours is here	onbecamezoidberg(inst)    inst:ListenForEvent("ms_respawnedfromghost", onbecamezoidberg)    inst:ListenForEvent("ms_becameghost", onbecameghost)end

Share this post


Link to post
Share on other sites

Thanks for the help, dude. May I attach the prefab so you can show me where it goes? That'd help me understand a bit more. I'm a noob at coding, the only thing he does so far is have 70 damage without a weapon (which I get it, that's kinda OP, no need to tell me, I plan to lower it, it's moreso for testing purposes). Anyways, hope you can help me out.

zoidberg.lua

Share this post


Link to post
Share on other sites

Thanks, dude! It works great now! The regen is just right, and the sanity regen is good without being overpowered! What's your Steam name so I can add you to the list of the contributors once I upload it? Also, are there any other things, perhaps negative things, that you think a Zoidberg character would carry? (Assuming you've seen Futurama, if not, that's fine. Also, I'd love to PM you and talk more about the code. You really saved me there! ^^)

Share this post


Link to post
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
Sign in to follow this