Issue with disabling ResetButtonCallback

Hey everyone, I’ve made a plugin that handles disabling certain Roblox features and I was doing a rewrite of the code but I’ve come into an issue with this line:

I get this in my output:

image

Plugin if anyone wants to try and debug (you can insert this into %LocalAppData%\Roblox\Plugins): DisableCoreGUIFunctions v2.rbxmx (12.0 KB)

Plugins code
-- I'm finally spending time on this to make a v2 that works amazingly

local toolbar = plugin:CreateToolbar("Disable CoreGUI Functions v2.0 by GamersInternational")

local disablechatbutton = toolbar:CreateButton("Disable Chat", "This button inserts a LocalScript that disables chat.", "rbxassetid://4458901886")
local disablehealthbarbutton = toolbar:CreateButton("Disable Health Bar", "This button inserts a LocalScript that disables the health bar popping up next to the menu button when you take damage in a game.", "rbxassetid://4458901886")
local disablebackpackbutton = toolbar:CreateButton("Disable Backpack", "This button inserts a LocalScript that disables the backpack function in game. When disabling, any tools that go into the backpack will not work unless you have an alternative backpack.", "rbxassetid://4458901886")
local disableplayerlistbutton = toolbar:CreateButton("Disable Leaderboard/PlayerList", "This button inserts a LocalScript that disables the Roblox leaderboard/playerlist.", "rbxassetid://4458901886")
local disableemotesbutton = toolbar:CreateButton("Disable Emotes", "This button inserts a LocalScript that disables the emotes GUI. Players will still be able to use emotes if they type them into the Roblox chat.", "rbxassetid://4458901886")
local disableresetbutton = toolbar:CreateButton("Disable Reset Character", "This button inserts a LocalScript into StarterGUI that disables the reset character button in the Roblox menu.", "rbxassetid://4458901886")
local disableshiftlockbutton = toolbar:CreateButton("Disable Shift Lock Switch", "This button inserts a Script into Workspace that disables the shift lock switch toggle in the Roblox menu.", "rbxassetid://4458901886")

local SPS = game.StarterPlayer.StarterPlayerScripts

disablechatbutton.Click:Connect (function()
	if SPS:FindFirstChild("DisableCoreGUIFunctions") then
		SPS.DisableCoreGUIFunctions:SetAttribute("Chat", false)
	else
		local Script = Instance.new("LocalScript")
		Script.Parent = SPS
		Script.Name = "DisableCoreGUIFunctions"
		Script:SetAttribute("Chat", false)
		Script:SetAttribute("Backpack", true)
		Script:SetAttribute("PlayerList", true)
		Script:SetAttribute("EmotesMenu", true)
		Script:SetAttribute("ResetButtonCallback", true)
		Script:SetAttribute("Health", true)
		Script:SetAttribute("ShiftLockEnabled", true)
		Script.Source = [[
		-- Support development of this project and other projects at www.roblox.com/games/6010987912
		local SG = game:GetService('StarterGui')
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, script:GetAttribute("Chat"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, script:GetAttribute("Backpack"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, script:GetAttribute("PlayerList"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, script:GetAttribute("EmotesMenu"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Health, script:GetAttribute("Health"))
		SG:SetCore('ResetButtonCallback', script:GetAttribute("ResetButtonCallback"))
		game.StarterPlayer.EnableMouseLockOption = script:GetAttribute("ShiftLockEnabled")
		]]
	end
end)

disablehealthbarbutton.Click:Connect (function()
	if SPS:FindFirstChild("DisableCoreGUIFunctions") then
		SPS.DisableCoreGUIFunctions:SetAttribute("Health", false)
	else
		local Script = Instance.new("LocalScript")
		Script.Parent = SPS
		Script.Name = "DisableCoreGUIFunctions"
		Script:SetAttribute("Chat", true)
		Script:SetAttribute("Backpack", true)
		Script:SetAttribute("PlayerList", true)
		Script:SetAttribute("EmotesMenu", true)
		Script:SetAttribute("ResetButtonCallback", true)
		Script:SetAttribute("Health", false)
		Script:SetAttribute("ShiftLockEnabled", true)
		Script.Source = [[
		-- Support development of this project and other projects at www.roblox.com/games/6010987912
		local SG = game:GetService('StarterGui')
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, script:GetAttribute("Chat"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, script:GetAttribute("Backpack"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, script:GetAttribute("PlayerList"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, script:GetAttribute("EmotesMenu"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Health, script:GetAttribute("Health"))
		SG:SetCore('ResetButtonCallback', script:GetAttribute("ResetButtonCallback"))
		game.StarterPlayer.EnableMouseLockOption = script:GetAttribute("ShiftLockEnabled")
		]]
	end
end)

disablebackpackbutton.Click:Connect (function()
	if SPS:FindFirstChild("DisableCoreGUIFunctions") then
		SPS.DisableCoreGUIFunctions:SetAttribute("Backpack", false)
	else
		local Script = Instance.new("LocalScript")
		Script.Parent = SPS
		Script.Name = "DisableCoreGUIFunctions"
		Script:SetAttribute("Chat", true)
		Script:SetAttribute("Backpack", false)
		Script:SetAttribute("PlayerList", true)
		Script:SetAttribute("EmotesMenu", true)
		Script:SetAttribute("ResetButtonCallback", true)
		Script:SetAttribute("Health", true)
		Script:SetAttribute("ShiftLockEnabled", true)
		Script.Source = [[
		-- Support development of this project and other projects at www.roblox.com/games/6010987912
		local SG = game:GetService('StarterGui')
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, script:GetAttribute("Chat"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, script:GetAttribute("Backpack"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, script:GetAttribute("PlayerList"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, script:GetAttribute("EmotesMenu"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Health, script:GetAttribute("Health"))
		SG:SetCore('ResetButtonCallback', script:GetAttribute("ResetButtonCallback"))
		game.StarterPlayer.EnableMouseLockOption = script:GetAttribute("ShiftLockEnabled")
		]]
	end
end)

disableplayerlistbutton.Click:Connect (function()
	if SPS:FindFirstChild("DisableCoreGUIFunctions") then
		SPS.DisableCoreGUIFunctions:SetAttribute("PlayerList", false)
	else
		local Script = Instance.new("LocalScript")
		Script.Parent = SPS
		Script.Name = "DisableCoreGUIFunctions"
		Script:SetAttribute("Chat", true)
		Script:SetAttribute("Backpack", true)
		Script:SetAttribute("PlayerList", false)
		Script:SetAttribute("EmotesMenu", true)
		Script:SetAttribute("ResetButtonCallback", true)
		Script:SetAttribute("Health", true)
		Script:SetAttribute("ShiftLockEnabled", true)
		Script.Source = [[
		-- Support development of this project and other projects at www.roblox.com/games/6010987912
		local SG = game:GetService('StarterGui')
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, script:GetAttribute("Chat"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, script:GetAttribute("Backpack"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, script:GetAttribute("PlayerList"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, script:GetAttribute("EmotesMenu"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Health, script:GetAttribute("Health"))
		SG:SetCore('ResetButtonCallback', script:GetAttribute("ResetButtonCallback"))
		game.StarterPlayer.EnableMouseLockOption = script:GetAttribute("ShiftLockEnabled")
		]]
	end
end)

disableemotesbutton.Click:Connect (function()
	if SPS:FindFirstChild("DisableCoreGUIFunctions") then
		SPS.DisableCoreGUIFunctions:SetAttribute("EmotesMenu", false)
	else
		local Script = Instance.new("LocalScript")
		Script.Parent = SPS
		Script.Name = "DisableCoreGUIFunctions"
		Script:SetAttribute("Chat", true)
		Script:SetAttribute("Backpack", true)
		Script:SetAttribute("PlayerList", true)
		Script:SetAttribute("EmotesMenu", false)
		Script:SetAttribute("ResetButtonCallback", true)
		Script:SetAttribute("Health", true)
		Script:SetAttribute("ShiftLockEnabled", true)
		Script.Source = [[
		-- Support development of this project and other projects at www.roblox.com/games/6010987912
		local SG = game:GetService('StarterGui')
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, script:GetAttribute("Chat"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, script:GetAttribute("Backpack"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, script:GetAttribute("PlayerList"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, script:GetAttribute("EmotesMenu"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Health, script:GetAttribute("Health"))
		SG:SetCore('ResetButtonCallback', script:GetAttribute("ResetButtonCallback"))
		game.StarterPlayer.EnableMouseLockOption = script:GetAttribute("ShiftLockEnabled")
		]]
	end
end)

disableresetbutton.Click:Connect (function()
	if SPS:FindFirstChild("DisableCoreGUIFunctions") then
		SPS.DisableCoreGUIFunctions:SetAttribute("ResetButtonCallback", false)
	else
		local Script = Instance.new("LocalScript")
		Script.Parent = SPS
		Script.Name = "DisableCoreGUIFunctions"
		Script:SetAttribute("Chat", true)
		Script:SetAttribute("Backpack", true)
		Script:SetAttribute("PlayerList", true)
		Script:SetAttribute("EmotesMenu", true)
		Script:SetAttribute("ResetButtonCallback", false)
		Script:SetAttribute("Health", true)
		Script:SetAttribute("ShiftLockEnabled", true)
		Script.Source = [[
		-- Support development of this project and other projects at www.roblox.com/games/6010987912
		local SG = game:GetService('StarterGui')
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, script:GetAttribute("Chat"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, script:GetAttribute("Backpack"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, script:GetAttribute("PlayerList"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, script:GetAttribute("EmotesMenu"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Health, script:GetAttribute("Health"))
		SG:SetCore('ResetButtonCallback', script:GetAttribute("ResetButtonCallback"))
		game.StarterPlayer.EnableMouseLockOption = script:GetAttribute("ShiftLockEnabled")
		]]
	end
end)

disableshiftlockbutton.Click:Connect (function()
	if SPS:FindFirstChild("DisableCoreGUIFunctions") then
		SPS.DisableCoreGUIFunctions:SetAttribute("ShiftLockEnabled", false)
	else
		local Script = Instance.new("LocalScript")
		Script.Parent = SPS
		Script.Name = "DisableCoreGUIFunctions"
		Script:SetAttribute("Chat", true)
		Script:SetAttribute("Backpack", true)
		Script:SetAttribute("PlayerList", true)
		Script:SetAttribute("EmotesMenu", true)
		Script:SetAttribute("ResetButtonCallback", true)
		Script:SetAttribute("Health", true)
		Script:SetAttribute("ShiftLockEnabled", false)
		Script.Source = [[
		-- Support development of this project and other projects at www.roblox.com/games/6010987912
		local SG = game:GetService('StarterGui')
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, script:GetAttribute("Chat"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, script:GetAttribute("Backpack"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, script:GetAttribute("PlayerList"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, script:GetAttribute("EmotesMenu"))
		SG:SetCoreGuiEnabled(Enum.CoreGuiType.Health, script:GetAttribute("Health"))
		SG:SetCore('ResetButtonCallback', script:GetAttribute("ResetButtonCallback"))
		game.StarterPlayer.EnableMouseLockOption = script:GetAttribute("ShiftLockEnabled")
		]]
	end
end)

The only thing I can possibly think of right now is the boolean attribute but considering how 5 other stuff (that relies on SetCoreGuiEnabled instead) works fine. ResetButtonCallback has two sorts of behaviour but I can’t see this being related to it:

This is because ResetButtonCallback is not guaranteed to be registered within a certain time frame. Here is a topic about this: ResetButtonCallback has not been registered by the CoreScripts

Thanks for the advice, I’ll be implementing the changes right now.

1 Like