Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help With Damage Script?

local debounce = true
function ot(part)
	local humanoid = part.Parent:FindFirstChild()
	if humanoid ~= nil then
		if game.Players:GetPlayerFromCharacter(humanoid.Parent).TeamColor == BrickColor.new("Bright blue") then
			if debounce == true then
			humanoid:TakeDamage(50)
			debounce = false
			end
		end
	end
end

script.Parent.Touched:connect(ot)

This script is supposed to have someone take 50 damage when they touch this, only if they're on the Bright blue team. It doesn't work. Some help?

2 answers

✓ Accepted answer

Line 3:

local humanoid = part.Parent:FindFirstChild("Humanoid")

You forgot to place Humanoid on lines 03 in the FindFirstChild method.

local humanoid = part.Parent:FindFirstChild("Humanoid")

This discussion is preserved as it was. New answers, comments, and votes are closed.