Most of the code works
debounce = true
if debounce then
script.Parent.Transparency = 0
elseif not debounce then
script.Parent.Transparency = .7
end
function OnHit(hit)
if debounce == true then
debounce = false -- prevents script to run event again.
print("All Good")
local human = hit.Parent
if human then
local player = game.Players:GetPlayerFromCharacter(human)
player.leaderstats.Speed.Value = player.leaderstat.Speed.Value+10
wait(5)
debounce = true -- allows script to run event again
end
end
end
script.Parent.Touched:Connect(OnHit)
Thats all the code. But this part
local human = hit.Parent
if human then
local player = game.Players:GetPlayerFromCharacter(human)
player.leaderstats.Speed.Value = player.leaderstat.Speed.Value+10
GetPlayerFromCharacter to Change Speed
