I’m making a particle effects module, and I’m making a SetIntensity function. (basically Rate but has higher limit) The title states my problem. I clearly used 2 numbers to perform division on.
Script Requiring module (test purposes)
local module = require(script.Parent.ServerEffectsModule)
local test = module:Create("Fire", game.Workspace)
module:SetIntensity(test, 300) --First number divided later
The module itself:
local serverEffects = {}
serverEffects.Fire = script.Fire
serverEffects.Smoke = script.Smoke
function serverEffects.Create(particle, parent)
local folderToClone = script:FindFirstChild(particle)
if folderToClone then
local clone = folderToClone:Clone()
clone.Parent = parent
end
end
function serverEffects.SetIntensity(particle, intensity)
local amountOfEffects = math.floor(intensity/200) --200, the second number involved in division. --Erroring line
local lastEffect = intensity%200
local effect = particle:FindFirstChildWhichIsA("ParticleEmitter")
effect = lastEffect
for i = 1, amountOfEffects-1 do
local newIntensity = effect:Clone()
newIntensity = 200
end
end
return serverEffects