The script works just fine but I am new to scripting and wondering if anyone has some pointers to make my script more efficient and less space consuming. -Thanks in advance
local Part = script.Parent.Head
Part.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local chara = workspace:FindFirstChild(player.Name)
if hit.Parent:FindFirstChild("Humanoid") then
if chara:FindFirstChild("SpeedTag") then
else
if hit.Parent.Humanoid.Health > 0 then
local hum = hit.Parent.Humanoid
hum.WalkSpeed = hum.WalkSpeed + 50
local speedtag = Instance.new("BoolValue")
speedtag.Name = "SpeedTag"
speedtag.Parent = workspace:FindFirstChild(player.Name)
end
end
end
end)
(The script takes whoever stands on it and adds speed if they havent already stood on it, adds a boolvalue to indicate that they have stepped on it. And if they try to step on it again, nothing happens due to the character having the bool in it.)
-P.S. it needs to add speed instead of setting it because I plan to add other speed boosters so they can stack.

4 comments
But if the player dies would that reset the debounce? The reason I had the bool was because when the player dies they lose the bool and can use it again.
ah! if you are talking about dying, i could refix the script to do that, but that would just make the script longer than yours. So I would recommend your script!
If you could, I would like to see your alternative for research purposes! :)
ok ill fix it later