You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Detect when Humanroot part enters and leaves the part -
What is the issue? Include screenshots / videos if possible!
it’s pretty much spamming the two prints consecutively -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Mixing up the denounces but I’m not sure what order things should be
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local mattouch = true -- debounce thing
AvgMat.Touched:Connect(function(hit) -- if hit
if not mattouch then return end -- is mat can be touch make false
mattouch = false
if not hit.Name == "HumanoidRootPart" then return end -- if hit is a root part
print("Touched by a person")
end)
AvgMat.TouchEnded:Connect(function(hit) -- Ended touch
if not hit.Name == "HumanoidRootPart" then return end -- if the part is a root part
print("Humanoid left")
mattouch = true -- allow touching
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.