So, I’m making a tower defense game, and I have a tower that slows enemies. There’s a gui to show that an enemy is being slowed, showing how much percent it is being slowed. But there’s an issue, my gui shows 100% slowing when it is supposed to show 75% slowing. (because my tower slows by 50% each shot) I know this is a flaw in my slowing variable script.
The script setting the percentage of slowing:
target.Attributes.Slowing.Value += config.FatigueAdd.Value --value is 0.5 to set the speed to 0.5 of its original.
target.Humanoid.WalkSpeed -= target.Humanoid.WalkSpeed * config.FatigueAdd.Value
--this part above here needs to be altered so it doesn't set to 100% on the second shot, but 75%.
game.ReplicatedStorage.Events.ChangeWalkSpeedAnimate:FireAllClients(target, config.FatigueAdd.Value, false)
wait(7.5)
if target.Parent ~= nil then
target.Attributes.Slowing.Value -= config.FatigueAdd.Value
target.Humanoid.WalkSpeed += target.Humanoid.WalkSpeed * config.FatigueAdd.Value
end