Hi, basically I have a script inside starter player scripts that disables the reset button, I want it so that the reset button is only disabled while the players are in an arena. The issue is, some players can be in the arena while others are not at the same time. Is there a way to disable and enable the script for specific players, or if I disable it will it mean the script is disabled for all players in the server? Thanks
1 Like
Setting it client-side shouldn’t change it for other players.
You can use the line:
game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)
and trigger it from a RemoteEvent
if you want to control who has it enabled and disabled at certain times.
2 Likes
Thanks, so where would I put this code?
Well, you can definitely use this code, and then you would put it in a LocalScript
in starter player scripts, it will only affect that player. You can than implement a remote event, or check when the team changes and toggle it on and off at your desire.
You can try this
local StarterGUI = game:GetService("StarterGui")
local DisableResetZone = workspace:WaitForChild("DisableResetZone")
local function EnableReset(State:boolean)
repeat
local success = pcall(function()
StarterGUI:SetCore("ResetButtonCallback", State)
end)
task.wait(1)
until success
end
DisableResetZone.Touched:Connect(function(otherPart)
if not otherPart then return end
if otherPart.Parent:FindFirstChild("Humanoid") then
EnableReset(false)
end
end)
DisableResetZone.TouchEnded:Connect(function(otherPart)
if not otherPart then return end
if otherPart.Parent:FindFirstChild("Humanoid") then
EnableReset(true)
end
end)
Replace “DisableResetZone” by your zone
Don’t forget you need to check if it’s a player touching the part - if there are other moving parts in the game, definitely.
1 Like