Way to disable resetting on a specific player?

Hello, as the title explains, I’m trying to disable the reset button for a player and for a determined amount of time, If I use:

game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)

The result will be that no players ingame will be able to reset until i manually enable resetting again, which is not what I’m going for, is there a way to do this, but with individual players?

StarterGui:SetCore seems to only work in local scripts. And when you do that in a local script, it’ll only disable resetting for that one player.

If you want to do it for a specific player, try

local player = game.Players.LocalPlayer

if player.Name = "  (username of the player) " then
game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)

if not, explain how you want to get the player to have resetting disabled, anyway thank you for reading, hope you have an amazing day/night.

Try using a Script and LocalScript together with a RemoteEvent.
For example (script):

script.Parent.EventHappened:Connect(function(playerName)
    game.ReplicatedStorage.RemoteEventDisableReset:FireClient(playerName) -- or FireAllClients if needed
end)

Now LocalScript, parented under StarterPlayerScripts:

game.ReplicatedStorage.RemoteEventDisableReset.OnClientEvent:Connect(function()
    game.StarterGui:SetCore("ResetButtonCallback", false)
    wait(60) -- or whatever amount of time
    game.StarterGui:SetCore("ResetButtonCallback", false)
end)

This should work, tell me if it doesn’t!

Sorry for the late response, I will try this right now and inform you of the results.

If you want an easier way, just change the humanoid’s name of the player. (the reset button won’t appear grey)

Yeah, I tried that before but then I realized it could be a foundational error, since in the future. When I use something like :LoadAnimation on the Humanoid with Character:WaitForChild(“Humanoid”) the script will yield until the wait time is over, which in my case it would be at least 20 seconds

I did some changes to the script you sent and it worked perfectly.

local rp = game:GetService("ReplicatedStorage")
local Remotes = rp.Remotes
local Disable = Remotes:WaitForChild("ResetDisable")

Disable.OnClientEvent:Connect(function(waitAmount)
	game.StarterGui:SetCore("ResetButtonCallback", false)
	
	wait(waitAmount)
	
	game.StarterGui:SetCore("ResetButtonCallback", true) -- changed to true since putting it on false disables it
end)

3 Likes