How do i convert this in to % of speed lost with no limit except the speed can't be less then 12 as an example

local players = game:GetService("Players")

local part = script.Parent
local boolean = false

local cooldown = 3
local percentage = 50 -- 50% out of 100%
local maxWalkSpeed = 1000000000000000000000000000000

part.Touched:connect(function(other)
	local player = players:GetPlayerFromCharacter(other.Parent)
	if player and not boolean then
		boolean = true
		local humanoid = player.Character:FindFirstChild("Humanoid")
		humanoid.WalkSpeed -= math.floor(humanoid.WalkSpeed / maxWalkSpeed * percentage)
		wait(cooldown)
		boolean = false
	end
end)

No, that’s 50, not 50%. 50% would be 0.5.

okkkkkkkkk amigo
thanks for this. What a obvious fix

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.