-- Gives temporary speed boost
local part = script.Parent
local function onTouch(otherPart)
-- Looks for a humanoid and stores it
local character = otherPart.Parent
local humanoid = character:FindFirstChildWhichIsA ("Humanoid")
-- Print statement for debugging
print("Something touched speedBoost")
-- Checks for Humanoid without speed boost
if humanoid and humanoid.WalkSpeed <= 16 then
print("A humanoid touched speedBoost")
-- Change to faster speed, wait, then change to normal
humanoid.WalkSpeed = 50
print("Player is moving super fast!")
wait(2)
humanoid.WalkSpeed = 16
print("Player is back at normal speed")
end
end
part.Touched:Connect(onTouch)