Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why isnt my plugin showing up in the plugin bar ? Errors in the code ?

This is the script from my antivirus script that won't show up in the plugin bar. I have no idea why please help me ! Is it something wrong with the top section or do i need to connect something maybe?

-- "Realtime Protection" script by andyagent .Copyright protected DO NOT COPY! 
-- Toolbar setup section--
local Version = "1.0"
local Toolbar = plugin:CreateToolbar("Realtime Protection by Roblox Defender Version " .. Version)
local Button1 = Toolbar:CreateButton(
	"Enable", -- Button Name
	"Click to Enable Roblox Defenders Realtime Protection.", -- Hover text
	"http://www.roblox.com/asset/?id=396631720" -- Icon's roblox url
	)
-- The beginning of the scripts function--
local LightingLock = true -- True will prevent any lighting changes, or adding skyboxes in-game (skyboxes saved to the game will stay). Will prevent Time of Day scripts and similar from working.
-- Virus Protection:
local Antivirus = {Enabled = true, Names = {"virus", "virus2", }} -- If something is added to Workspace, it will be removed if its name is in this table. Not caps sensitive.
-- Additional Features:
local WhiteList = {Enabled = false, WhiteListedUsers = {"Player1"}} -- Enabled whitelist only allows people with their names in the table to join the game.

-- Do not edit below this point if you do not know what you are doing --

local ActiveProtectChest
if not game.ServerStorage:FindFirstChild("Realtime Protection Quarantine V.1") then
	ActiveProtectChest = Instance.new("Folder", game.ServerStorage)
	ActiveProtectChest.Name = "Realtime Protection Quarantine V.1"
else
	ActiveProtectChest = game.ServerStorage:FindFirstChild("Realtime Protection Quarantine V.1")
end

-- 1. Lighting Lock
game.Lighting.ChildAdded:connect(function(Instance)
	if LightingLock then
		if Instance.ClassName == "Sky" then
			wait()
			Instance.Parent = ActiveProtectChest
		end		
	end	
end)
local Lighting = game:GetService("Lighting")
local LightingNames = {"Ambient","Brightness","ColorShift_Bottom","ColorShift_Top","GlobalShadows","OutdoorAmbient","Outlines","ShadowColor","GeographicLatitude","TimeOfDay","FogColor","FogEnd","FogStart"}
local LightingProperties = {Lighting.Ambient,Lighting.Brightness,Lighting.ColorShift_Bottom,Lighting.ColorShift_Top,Lighting.GlobalShadows,Lighting.OutdoorAmbient,Lighting.Outlines,Lighting.ShadowColor,Lighting.GeographicLatitude,Lighting.TimeOfDay,Lighting.FogColor,Lighting.FogEnd,Lighting.FogStart}
Lighting.Changed:connect(function()
	if LightingLock then
		for i,v in pairs(LightingNames) do
			Lighting[v] = LightingProperties[i]
		end
	end
end)

-- 2. Basic Virus Protection. Not in-depth as Workspace Scan in the Plugin.
game.Workspace.DescendantAdded:connect(function(Instance)
	if Antivirus.Enabled then
		for i, v in pairs (Antivirus.Names) do
			if string.lower(Instance.Name) == string.lower(v) then
				wait()
				Instance.Parent = ActiveProtectChest
			end
		end
	end
end)
-- 3. White List
game.Players.PlayerAdded:connect(function(Player)
	if WhiteList.Enabled then
		local PlayerAllowed
		for i, v in pairs (WhiteList.WhiteListedUsers) do
			if Player.Name == v then
				PlayerAllowed = true
				break
			end
		end
		if not PlayerAllowed then
			Player:Kick("You are not whitelisted on this server.")
		end
	end
end)

1 comment

0

The script looks ok to me, add a print at the top of the code to check that the script is being ran.

1 answer

I quickly scanned your code. Before I really read it, let me ask you this.

You updated your plugin to your latest version and you installed it?

1 comment

0

Yes

This discussion is preserved as it was. New answers, comments, and votes are closed.