debounce = false
function onTouched(part)
if debounce == false then
debounce = true
local h = part.Parent:findFirstChild("Humanoid")
if h ~= nil then
local Player = game.Players:GetPlayerFromCharacter(part.Parent)
Player.leaderstats.Score.Value = Player.leaderstats.Score.Value - 1
game.Players:FindFirstChild(Player.leaderstats.LastHit).leaderstats.Score.Value = game.Players:FindFirstChild(Player.leaderstats.LastHit).leaderstats.Score.Value+1
Player:LoadCharacter()
debounce = false
end
end
end
script.Parent.Touched:Connect(onTouched)
on line 11, apparently Player doesnt exist, but i tried using prints and it does.

5 comments
Imagine if another brick touched it.......... WAIT THIS GUY HAS MESSY CODE IM NOT SUPPOSED TO GIVE ANSWERS
^Do not bash on peoples questions. This site is meant to help people. not bash people.
Sorry, hiimgoodpack, I usually make code, then go back and edit stuff in between the lines, so roblox's auto indenting doesnt kick in. It couldn't be another brick though, because in the code i use an if statement to make sure the part touching this brick is parented under a humanoid.
Hiimgoodpack, stop acting to mental these days about the "Tabs"
can you post the exact error?