I’ve been making a game recently. But, my Reset Disabler script isn’t working.
I’ll try not to waste your time by explaining what i want to achieve with the default #help-and-feedback:scripting-support template.
What do i want to achieve? Succesfully use my Reset Disabler script.
What is the issue? The reset button is still working like normal.
What solutions have you tried so far? I have searched the devforums a bit. Nothing helped, the same issue happened.
The following script is what i used. Please note that it’s inside a LocalScript object, which is in StarterGui.
Nothing shows up in the output when i run the game. Also, the only way that i’ve found to “fix” it is to reset which then disables the reset. I don’t want to use that “fix”, since it’s really hack-y.
I’m not entirely sure if this is true, but can you try placing the script in ReplicatedFirst… i vaguely remember using SetCore requires the call to be relatively recent in the call line.
Also make sure to pcall it and some other stuff, and repeat the call if it happens across an error, seeing as SetCore might not work all the time if the Core UI you are setting has not loaded yet…
It’s been a while since I did anything messing with the core UI, so i could be off the board with this reply…
local StarterGui = game:GetService('StarterGui')
local suc = pcall(StarterGui.SetCore, StarterGui, 'ResetButtonCallback', false)
while not suc do
suc = pcall(StarterGui.SetCore, StarterGui, 'ResetButtonCallback', false)
end
Just tried that, the output said
21:18:17.944 Script timeout: exhausted allowed execution time - Client - ResetDisabler:3
21:18:17.944 Stack Begin - Studio
21:18:17.944 Script ‘ReplicatedFirst.ResetDisabler’, Line 3 - Studio - ResetDisabler:3
21:18:17.944 Stack End - Studio
local StarterGui = game:GetService('StarterGui')
local RunService = game:GetService('RunService')
local connection
connection = RunService.Heartbeat:Connect(function()
local success = pcall(StarterGui.SetCore, StarterGui, 'ResetButtonCallback', false)
if success then
connection:Disconnect()
end
end)