#Blur Effect after I touch a part.

160 messages · Page 1 of 1 (latest)

jaunty coyote
#

Hello, I need help on adding blur effect after I touch a part and removing that blur effect after I touch a different part.

midnight salmon
#

local part = script.Parent
local L = game:WaitForChild(“Lighting”)
local blur = L:WaitForChild(“partBlur”)

part.Touched:Connect(function(player)
blur.Enabled = true
end)

jaunty coyote
#

I tried that

#

but am i supposed to have another part or do I just add the script to the part

#

@midnight salmon

midnight salmon
#

Script to the part

jaunty coyote
#

ok

#

i did

#

but do I have to rename it?

midnight salmon
#

No.

jaunty coyote
#

it did not work

midnight salmon
#

Error?

jaunty coyote
#

Workspace.part.Script:2: Expected identifier when parsing expression, got Unicode character U+201c (did you mean '"'?)

#

this is what I got in the output

#

@midnight salmon

wooden oracleBOT
#

studio** You are now Level 1! **studio

midnight salmon
#

Yeah

#

Cause I am on phone now.

dusty junco
#

hi

jaunty coyote
ebon spruce
#
local Lighting = game:GetService("Lighting")
local BlurEffect = Lighting.BlurEffect

script.Parent.Touched:Connect(function()
    BlurEffect.Blur = 25
end)
wooden oracleBOT
#

studio** You are now Level 5! **studio

jaunty coyote
#

thanks

#

let me see if this works

ebon spruce
#

This is judging it's a local script inside the part.

jaunty coyote
#

oh

ebon spruce
#

?

jaunty coyote
#

so i just have to add it to the part

ebon spruce
#

Is it a server script?

#

Do you want the effect to be seen just by the player who touched the part?

jaunty coyote
#

who touched the part

jaunty coyote
#

like if one player touched the part it happenes to everyone

subtle anchor
#
for i, v in pairs(workspace:GetChildren()) do
    if v:IsA('Part') or v:IsA('MeshPart') then
        v.Touched:Connect(function(hit)
            if hit then
                if hit.Parent:FindFirstChildOfClass('Humanoid') then
                    if game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect') and game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect').Enabled == false then
                        game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect').Enabled = false
                    elseif game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect') and game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect').Enabled == true then
                        game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect').Enabled = false
                    end
                end
            end
        end)
    end
end
#

Put this in server script service

dusty junco
#

isn’t it supposed to be once touched?

wooden oracleBOT
#

studio** You are now Level 1! **studio

subtle anchor
#

İs it

#

just try it

dusty junco
#

It doesn’t work

subtle anchor
#

what do you want

#

i should work

jaunty coyote
#

I want

dusty junco
#

Once a current part is touched then blur affect wirka

#

works

jaunty coyote
#

when one player touched a part the whole game gets a blur

subtle anchor
#

so

#

it should do that

jaunty coyote
#

its not

#

i tried

subtle anchor
#

bc its a server script

#

ok

jaunty coyote
#

it does not work

#

still

#

do I have to put a script in the server script service

subtle anchor
#

well i tried it and it does not work for me idk why

jaunty coyote
#

same

subtle anchor
#

ohhh

#

i did false

#

for 2

#

wait

#
for i, v in pairs(workspace:GetChildren()) do
    if v:IsA('Part') or v:IsA('MeshPart') then
        v.Touched:Connect(function(hit)
            if hit then
                if hit.Parent:FindFirstChildOfClass('Humanoid') then
                    if game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect') and game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect').Enabled == false then
                        game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect').Enabled = true
                    elseif game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect') and game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect').Enabled == true then
                        game:GetService('Lighting'):FindFirstChildOfClass('BlurEffect').Enabled = false
                    end
                end
            end
        end)
    end
end
#

it should work

#

lol my dumbass

#

sorry

jaunty coyote
#

its ok

#

let me try

#

nope

#

still not

subtle anchor
#

put it in a server script service

jaunty coyote
#

i did

#

do I have to add the blur on the server script service

dusty junco
#

How does it know what part to touch to work?

subtle anchor
jaunty coyote
#

well the part is a spawn point

wooden oracleBOT
#

studio** You are now Level 2! **studio

dusty junco
#

ok

subtle anchor
jaunty coyote
#

ok

dusty junco
#

but if u put blur in the lighting

#

then there’s no point of adding the script

#

cuz you already got the blur then

subtle anchor
#

oh you wanna create in the script

dusty junco
#

ye

subtle anchor
#

well do you guys know how to script

dusty junco
#

nah I just know a little

jaunty coyote
#

Idk if that will work

subtle anchor
#

wait

#

this is that

#

creates blur

#

and you dont have to put one

#

wait

#
local blur = Instance.new('BlurEffect')

for i, v in pairs(workspace:GetChildren()) do
    if v:IsA('Part') or v:IsA('MeshPart') then
        v.Touched:Connect(function(hit)
            if hit then
                if hit.Parent:FindFirstChildOfClass('Humanoid') then
                    
                    local cB = blur:Clone()
                    cB.Enabled = false
                    cB.Parent = workspace.Camera
                    
                    if cB and cB.Enabled == false then
                        cB.Enabled = true
                    elseif cB and cB.Enabled == true then
                        cB:Destroy()
                    end
                    
                end
            end
        end)
    end
end
#

here

jaunty coyote
#

Do i still put it in service script

subtle anchor
#

yes

jaunty coyote
#

ok

#

thanks

subtle anchor
#

np

dusty junco
#

did it work ved?

jaunty coyote
#

nope

#

do i have to add blur in lighting

subtle anchor
#

no but

#

wait

jaunty coyote
#

it still did not work

subtle anchor
#
local blur = Instance.new('BlurEffect')

for i, v in pairs(workspace:GetChildren()) do
    if v:IsA('Part') or v:IsA('MeshPart') then
        v.Touched:Connect(function(hit)
            if hit then
                if hit.Parent:FindFirstChildOfClass('Humanoid') then
                    
                    local cB = blur:Clone()
                    cB.Enabled = false
                    cB.Parent = game:GetService('Lightning')
                    
                    if cB and cB.Enabled == false then
                        cB.Enabled = true
                    elseif cB and cB.Enabled == true then
                        cB:Destroy()
                    end
                    
                end
            end
        end)
    end
end
#

try this

jaunty coyote
#

k

#

nope

#

still not]

subtle anchor
#

well

#

idk at this point

jaunty coyote
#

its says

#

like

#

its says

#

lighting is not a valid name

#

line 11

#

Script 'ServerScriptService.Script', Line 11

subtle anchor
#

ohhhh

#

my bad english

#
local blur = Instance.new('BlurEffect')

for i, v in pairs(workspace:GetChildren()) do
    if v:IsA('Part') or v:IsA('MeshPart') then
        v.Touched:Connect(function(hit)
            if hit then
                if hit.Parent:FindFirstChildOfClass('Humanoid') then
                    
                    local cB = blur:Clone()
                    cB.Enabled = false
                    cB.Parent = game:GetService('Lighting')
                    
                    if cB and cB.Enabled == false then
                        cB.Enabled = true
                    elseif cB and cB.Enabled == true then
                        cB:Destroy()
                    end
                    
                end
            end
        end)
    end
end
#

try this

jaunty coyote
#

😮

dusty junco
#

it worked??

jaunty coyote
#

🫡

#

yes

dusty junco
#

W

jaunty coyote
#

thanks so much

subtle anchor
#

nice

jaunty coyote
#

bro

dusty junco
#

After so long ong

jaunty coyote
#

thanks

dusty junco
#

Ty

#

Tysm

#

Ved

jaunty coyote
#

you dont know how much your helped

subtle anchor
#

glad to help

dusty junco
#

did it work after u tocuhed the part

jaunty coyote
#

ye

dusty junco
#

W

jaunty coyote
#

should i put it in the game

dusty junco
#

Nrn

#

I’ll put it

#

send me the script

subtle anchor
#

oh you guys are friend huh

dusty junco
#

ur

#

Yes

subtle anchor
#

it feels amazing to help people

jaunty coyote
#

thanks so much

dusty junco
#

Bru

jaunty coyote
dusty junco
#

I want a scripter

#

but

#

they cost so much

dusty junco
#

dm em