idk why this script is not working
script.Parent.Touched:Connect(function(hit) print("hit") if hit.Name == "dttector" then print("Hit by dttector") script.Parent.Parent.a.Transparency = 1 script.Parent.Parent.b.Transparency = 1 script.Parent.Parent.c.Transparency = 1 script.Parent.Parent.d.Transparency = 1 script.Parent.Parent.e.Transparency = 1 end end) script.Parent.TouchEnded:Connect(function() script.Parent.Parent.a.Transparency = 0.8 script.Parent.Parent.b.Transparency = 0 script.Parent.Parent.c.Transparency = 0 script.Parent.Parent.d.Transparency = 0 script.Parent.Parent.e.Transparency = 0 end)
the prints are not running. the Part is named "dttector".
Hello kittensgaming123! Remove line: 02. and make sure to inserted in dttector
Part as a Script
. The new script:
script.Parent.Touched:Connect(function(hit) script.Parent.Parent.a.Transparency = 1 script.Parent.Parent.b.Transparency = 1 script.Parent.Parent.c.Transparency = 1 script.Parent.Parent.d.Transparency = 1 script.Parent.Parent.e.Transparency = 1 end) script.Parent.TouchEnded:Connect(function() script.Parent.Parent.a.Transparency = 0.8 script.Parent.Parent.b.Transparency = 0 script.Parent.Parent.c.Transparency = 0 script.Parent.Parent.d.Transparency = 0 script.Parent.Parent.e.Transparency = 0 end)
I hope that helps you. Good luck.
script.Parent.Touched:Connect(function(hit) if hit.name == "dttector" then -- I see one mistake here (Read the bottom for more detail(s))
script.Parent.Parent.a.Transparency = 1 script.Parent.Parent.b.Transparency = 1 script.Parent.Parent.c.Transparency = 1 script.Parent.Parent.d.Transparency = 1 script.Parent.Parent.e.Transparency = 1 end end) script.Parent.TouchEnded:Connect(function() script.Parent.Parent.a.Transparency = 0.8 script.Parent.Parent.b.Transparency = 0 script.Parent.Parent.c.Transparency = 0 script.Parent.Parent.d.Transparency = 0 script.Parent.Parent.e.Transparency = 0
end)
I think your if statement should say:
if hit:FindFirstChild("Humanoid") or hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid") then
-- If a player touched it, and the script found the "Humanoid" any code in here will run!
end