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

Humanoid ontouched help? If then else help

Henlo, guys. Trying to make a kill script that doesn't hurt me, why doesn't this work?

function onTouched(hit)
	if not hit or not hit.Parent then return end
	local human = hit.Parent:findFirstChild("Humanoid")
	if human and human:IsA("Humanoid") then
		if human.Parent.Name == "QuantumWaffle" then
			print ("NO!")
			wait(1)
		end
		else
		script.Parent.Transparency = 1
		script.Parent.Part.Transparency = 0
		human.Parent.Head.Anchored = true
		script.Parent.kerchoo:Play()
		script.Parent.Ouch:Play()
		wait(7)
		human:TakeDamage(100)
		script.Parent.Part.Transparency = 1
		script.Parent.Transparency = 0
		
	end
end

script.Parent.Touched:connect(onTouched)

Please, if you can, post an edited version. Thanks!

1 answer

✓ Accepted answer

Your end is in the wrong position. Move the end on line8 to the bottom.

1 comment

0

With bottom i mean line 19

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