local Char = players.LocalPlayer.Character
local Frame = game.Lighting.Foggy
Char:FindFirstChildOfClass("Humanoid").Died:Connect(function()
Frame.Enabled = false -- Did you mean to disable this?
TweenService:Create(Frame, TweenInfo.new(2), {Size = 0}):Play()
end)
Did you mean to disable the frame? Also, this:
local Char = players.LocalPlayer.Character
Should be changed to this:
local Char = players.LocalPlayer.Character or players.LocalPlayer.CharacterAdded:Wait()
local TweenService = game:GetService("TweenService")
local players = game:GetService("Players")
local map = workspace:FindFirstChild("Map")
local partt = map:FindFirstChild("Map Rooms"):FindFirstChild("Boiler Room"):FindFirstChild("FogPart")
local frame = game.Lighting.Foggy
--local tween = TweenService:Create(frame, tweenInfo, Goal)
-- array of players currently touching this part
-- manipulated with table.find and table.remove because it's guaranteed not to grow larger than 100 players
local playersTouching = {}
function getPlayerFromRootPart(part)
return part.Name == "HumanoidRootPart" and game.Players:GetPlayerFromCharacter(part.Parent)
end
function onTouch(part)
if frame.Enabled == false then
frame.Enabled = true
end
local player = getPlayerFromRootPart(part)
if player ~= players.LocalPlayer then return end
if table.find(playersTouching, player) then return end
table.insert(playersTouching, player)
TweenService:Create(frame, TweenInfo.new(1), {Size = 10}):Play()
end
function onTouchEnded(part)
local player = getPlayerFromRootPart(part)
if player ~= game.Players.LocalPlayer then return end
local index = table.find(playersTouching, player)
if not index then return end
table.remove(playersTouching, index)
TweenService:Create(frame, TweenInfo.new(2), {Size = 0}):Play()
end
partt.Touched:Connect(onTouch)
partt.TouchEnded:Connect(onTouchEnded)
local Char = players.LocalPlayer.Character
Char:FindFirstChildOfClass("Humanoid").Died:Connect(function()
frame.Enabled = false
TweenService:Create(frame, TweenInfo.new(2), {Size = 0}):Play()
end)
I copy-pasted your whole script and it works without any problems. Do you have any other script that might change the BlurEffects’s Size property? Also, can you screenshot the entire output?