How can i prevent my plugin to execute in testing mode in studio?

Basically, when we join a play test in studio the plugin start runing again but fail with the following error .

So to prevent it, i thought maybe i can make it not run in play test.

-- Coming soon feature
--local Selection = game:GetService("Selection")

-- Get Services
local RunService = game:GetService("RunService")
local ServerStorage = game:GetService("ServerStorage")
local ChangeHistoryService = game:GetService("ChangeHistoryService")

-- Toolbar configuration
local toolbar = plugin:CreateToolbar("RoCatch Detection")

-- Setup Plugin buttons
local newScriptButton = toolbar:CreateButton("Malware analyser","This feature allows you to set a scan for advanced threats","rbxassetid://137137049577018")
local SettingsButton = toolbar:CreateButton("Configuration","Enter the configuration for real time protection and more","http://www.roblox.com/asset/?id=15859572237")
local SafeButton = toolbar:CreateButton("Safe","You can enable back disabled script from the safe. Making you're game probably less secure","http://www.roblox.com/asset/?id=953596610")

-- Threats count
local threatsfounds = 0
1 Like

is this one?

wait, i think the issue is related to the script in ServerScriptService, so maybe i can fix with

if script.Parent  == game:GetService("ServerScriptService") then
 script.Enabled = false
end

image

maybe if script:IsDescendantOf(game:GetService("ServerScriptService")) then return end ?

image

I used a self debugging method instead, if the error is the same as the other one then dont print and done.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.