I have seen numerous guides on this, and everyone says to use
script.parent.touched
, but for an unknown reason to me, in the dev console with the output, it does not show a print statement I put in the function. Please help!
Add this script to the part.
01 | local part = script.Parent |
02 |
03 | local function onPartTouched(otherPart) |
04 | local partParent = otherPart.Parent |
05 | local humanoid = partParent:FindFirstChildWhichIsA( "Humanoid" ) |
06 | if humanoid then |
07 | print :( "lol work coolio" ) |
08 | --game.Lighting.Blur.Size = 843748673958 |
09 | end |
10 | end |
11 |
12 | part.Touched:Connect(onPartTouched) |
Honestly not sure why this is happening for you, but maybe you made some small error that's unnoticeable. Maybe try copy-pasting the code above this answer or the one I put below to see if that works
01 | local part = script.Parent |
02 |
03 | part.Touched:Connect( function (touched) |
04 | print ( 'Works' ) |
05 | --add whatever here |
06 | end ) |
07 |
08 | --If you want to locate the character that touched it |
09 | part.Touched:Connect( function (touched) |
10 | local hum = touched.Parent:FindFirstChildOfClass( 'Humanoid' ) |
11 |
12 | if hum then |
13 | print ( 'pog' ) |
14 | --add whatever here |
15 | end |
16 | end ) |