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?
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)
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)