Page 1 of 1
effectReplacer.lua - replace 1.3 and block effects!
Posted: Sat Mar 29, 2025 1:45 pm
by MrDoubleA
Allows you to replace any 1.3 effect with any other effect, including custom ones. Also allows you to set a custom effect to spawn when a block is destroyed, instead of the default one.
Replacing an existing effect with a custom one:
Code: Select all
local effectReplacer = require("effectReplacer")
-- Replace the Goomba death effect (ID 4) with a custom effect (ID 751)
effectReplacer.registerID(4, 751)
-- Setting the replacement effect ID to 0 will result in the original effect simply being removed
effectReplacer.registerID(4, 0)
-- Alternatively, you can also provide a function that runs whenever the effect is replaced
effectReplacer.registerID(4, 751, function(oldEffect, newEffect)
newEffect.speedY = oldEffect.speedY
end)
Setting up an effect for a block being destroyed:
Code: Select all
local effectReplacer = require("effectReplacer")
-- Replace the destroy effect of the SMW cement block (ID 115) with effect ID 751
effectReplacer.registerBlockDestroyEffect(115, 751)
-- Setting the destroy effect ID to 0 will result in no effects spawning from the block
effectReplacer.registerBlockDestroyEffect(115, 0)
-- Alternatively, you can also provide a function that runs whenever the block is destroyed
effectReplacer.registerBlockDestroyEffect(115, 751, function(block, effect)
effect.speedY = block.speedY
end)
Download
Re: effectReplacer.lua - replace 1.3 and block effects!
Posted: Sat Mar 29, 2025 8:03 pm
by mariobrigade2018
YES! Thank you ohmygoodnessiamfreakingout AAAAAAAAAAAAAAAAAAAAAAAAAAAAA-
Re: effectReplacer.lua - replace 1.3 and block effects!
Posted: Sun Mar 30, 2025 6:13 am
by Donkdonker124
May you find everything valuable in life, MrDoubleA. Thank you.
Re: effectReplacer.lua - replace 1.3 and block effects!
Posted: Sun Mar 30, 2025 12:31 pm
by ilovehamburgerz
Re: effectReplacer.lua - replace 1.3 and block effects!
Posted: Wed Apr 02, 2025 11:23 am
by Mal8rk
This is such a useful script!!!
Although I'm not sure if I'm using it correctly or if there's something wrong with this because when I try to replace block 4's breaking effect, it still spawns the basegame effect
Here's my code:
Code: Select all
effectReplacer.registerBlockDestroyEffect(4, 955)