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

Why does my part fade away before I even get to touch it?[SOLVED]

local debounce = true
script.Parent.Touched:Connect(function(hit)
	print("Touched")
	if hit.Parent:FindFirstChild("Humanoid") then
		if debounce then
			debounce = false
		while script.Parent.Transparency <= 1 do 
			script.Parent.Transparency = script.Parent.Transparency + 0.004
			wait(0.01)
		end
		script.Parent.CanCollide = false
		wait(3)
		script.Parent.CanCollide = true
		script.Parent.Transparency = 0
		debounce = true
		end
	end
end)

It checks if the object hitting it is a humanoid, so why is it still activating? Same goes with my kill brick, it keeps printing.

1 answer

I don't know what you are talking about. The script works perfectly fine. I put the script into a normal part. When I touched it, it worked fine. The script acted like it was supposed to do.

2 comments

0

The thing is: He added NPCs to the game, and I told him to add Players:GetPlayerFromCharacter().

0

Oh ok.

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