Why Doesn't The Script Print Detected When Part Is Hit?
The Purpose Of This Script is to detect if a part (The Part Is The Parent Of The Script) touches another part named "SauceDetector". The Part "SauceDetector" is an unanchored, can collide off part the falls from right above the Part and touches the part. For some reason the Print("SauceDetected") Doesn't Print.
01 | function onTouched(hit) |
02 | if hit.Parent.Name = = "SauceDetector" then |
03 | print ( "SauceDetected" ) |
04 | script.Parent.Sauce.Value = true |
06 | if hit.Parent.Name = = "CheeseDetector" then |
07 | script.Parent.Cheese.Value = true |
09 | if hit.Parent.Name = = "PepperoniDetector" then |
10 | script.Parent.Pepperoni.Value = true |
12 | if hit.Parent.Name = = "MushroomDetector" then |
13 | script.Parent.Mushroom.Value = true |
16 | script.Parent.Touched:connect(onTouched) |
If You Know Why Its Not Detecting Please Let Me Know!