Basically what i want to make is a way the plugin doesnt call the function when a object get added by testing mode so peoples can sandbox to see if the plugin did the job at putting they game safe.
Attempted:
Multiple Run Service Checks
local Running
workspace.DescendantAdded:Connect(function(des)
Running = function()
if not RunService:IsStudio() then
return false
end
if not RunService:IsClient() then
return false
end
if not RunService:IsServer() then
return false
end
if not RunService:IsEdit() then
return false
end
if RunService:IsRunMode() then
return false
end
-- Running in edit mode
return true
end
if Running then
ChangeHistoryService:SetWaypoint("Analysing the new object")
AnalyseObject(des)
end
end)
local RunService = game:GetService("RunService")
local ChangeHistoryService = game:GetService("ChangeHistoryService")
workspace.DescendantAdded:Connect(function(des)
local Running = function()
if not RunService:IsStudio() then
return false
end
if not RunService:IsClient() and not RunService:IsServer() then
return false
end
if RunService:IsRunMode() then
return false
end
-- edit mode: true
return true
end
-- correct mode: true
if Running() then
ChangeHistoryService:SetWaypoint("Analysing the new object")
AnalyseObject(des)
end
end)