local function Deactivate()
for i,v in pairs(workspace.Builds.Campfires:GetChildren()) do
v.MountingRod.Cook.Enabled = false
end
end
This client function is supposed to disable all the proximity prompts connected to campfires. However, v.MountingRod.Cook.Enabled = false throw the error message: "invalid argument #2 (string expected, got Instance) " I checked, and v is a campfire model, so everything should line up.
You need to make a check if the instances found during the loop is a ProximityPrompt. Also, it’s better to use GetDescendants() in this situation.
local function Deactivate()
for i, v in pairs(workspace.Builds.Campfires:GetDescendants()) do
if v:IsA("ProximityPrompt") then -- checks if the instance is a ProximityPrompt
v.Enabled = false -- disables all ProximityPrompts under the 'Campfire' model
end
end
end