This script inside a block makes things go blurry when stepped on, but idk how to turn it off after stepping on again!
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 | game.Lighting.Blur.Size = 56 |
08 | end |
09 | end |
10 |
11 | part.Touched:Connect(onPartTouched) |
12 |
13 | local function onPartTouchedagain(otherPart) |
14 | local partParent = otherPart.Parent |
15 | local humanoid = partParent:FindFirstChildWhichIsA( "Humanoid" ) |
(yes i purposuely made the second part super bad to get u to fix lol)
it will detect when it is blurred then if it is it will make it unblur
01 | local part = script.Parent |
02 |
03 | part.Touched:Connect( function (hit) |
04 | local partParent = hit.Parent |
05 | local humanoid = partParent:FindFirstChildWhichIsA( "Humanoid" ) |
06 | if humanoid then |
07 |
08 | if game.Lighting.Blur.Size = 56 |
09 |
10 | game.Lighting.Blur.Size = 0 |
11 |
12 | else |
13 |
14 | game.Lighting.Blur.Size = 56 |
15 | end |
16 | end ) |
But you should probably add debounce since touched can register many times in seconds
01 | local part = script.Parent |
02 | local isFirstTime = true |
03 | local function onPartTouched(otherPart) |
04 | local partParent = otherPart.Parent |
05 | local humanoid = partParent:FindFirstChildWhichIsA( "Humanoid" ) |
06 | if humanoid then |
07 | if isFirstTime then |
08 | game.Lighting.Blur.Size = 56 |
09 | isFirstTime = false |
10 | else |
11 | game.Lighting.Blur.Size = 0 |
12 | end |
13 | end |
14 | end |
15 |
16 | part.Touched:Connect(onPartTouched) |