I have no idea how to script and can’t get ahold of the maker so I have no idea what the issue is.
local rs = game:GetService("ReplicatedStorage")
local event = rs:FindFirstChild("openGUI")
local detParts = { }
for _,v in pairs(script.Parent:GetChildren()) do
if v:IsA("Part") and string.sub(v.Name, 1, 9) == "DETECTION" then
table.insert(detParts, v.Name)
end
end
for _,v in pairs(detParts) do
script.Parent:FindFirstChild(v).Touched:Connect(function(obj)
if obj.Parent:IsA("Model") and game.Players:FindFirstChild(obj.Parent.Name) ~= nil then
local plr = game.Players:FindFirstChild(obj.Parent.Name)
event:FireClient(plr, string.sub(v, 11), true)
end
end)
script.Parent:FindFirstChild(v).TouchEnded:Connect(function(obj)
if obj.Parent:IsA("Model") and game.Players:FindFirstChild(obj.Parent.Name) ~= nil then
local plr = game.Players:FindFirstChild(obj.Parent.Name)
event:FireClient(plr, string.sub(v, 11), false)
end
end)
end
This is the error: [20:39:44.605 - Workspace.Freezers.FreezersServer:24: attempt to index nil with ‘FireClient’]
GIF of error: https://gyazo.com/0f09a0bedfd1444280bbc5de33553916