Hello! So, I’ve made a script that sets the reset button and the topbar to disabled for a certain amount of time, and then sets them back to enabled. For some reason, the script works sometimes, but throws this error other times:
The times it works and the time it doesn’t work are completely random. My script is currently this:
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCore("TopbarEnabled",false)
StarterGui:SetCore("ResetButtonCallback", false)
local fin = script.Parent.Handler.Finished
fin.Changed:Connect(function()
if fin.Value == true then
StarterGui:SetCore("TopbarEnabled",true)
StarterGui:SetCore("ResetButtonCallback", true)
end
end)
They’re not random. The error is saying the corescripts haven’t setup the property for ResetButtonCallback. The core scripts execute after your localscripts.
Enabling and disabling the resetbuttoncallback is really not recommended, as you are messing with core scripts that can potentially have performance repercussions within your games. Also, note that local scripts run only after core scripts, so it’s normal if it doesn’t work from time to time.
Thank you for your response! I will try my best to make little use of this, but as of right now, I need to enable and disable the reset button as it’s a necessary part of my game.
Theres no performance overhead from disabiling resets. You can lose players if the game allows them to get stuck anywhere they’d try to reset to get out of but theres no other cons to disabiling them.
The LocalScripts execute a great deal sooner than the CoreScripts, which is what’s causing this problem. This is a common occurence with properties the corescripts assign to after initalizing, such as CameraType, MouseIcon, and Focus.