I wish to create a handcuffs tool which allows a player to move a victim player around while putting them on the prisoner team. I have been extremely successful in creating this tool but would like it to prevent the prisoner from resetting while being moved. This would have to happen within the tool, so that when the tool activates and arrests a player it stops them from resetting. How would I go about this?
From what I believe, I don’t think you can stop a certain player from resetting (without disabling it from everyone), however you can punish them for it. For example, if they reset they’re on the prisoner team for maybe double the time, or they get an extra 200 seconds in prison.
You can track this with a humanoid.Died event, which you can check out this wiki page on it. It’ll help you with any questions you may have on the topic.
He can do a script that if the player gets arrested, that player’s Reset character button be disabled.
(local script)
The problem with this is that I don’t think you can target a player with this.
As i saw in your post is that you want to prevent arrested players reset. The link i send you contain a line which disables the reset script.
So instead of using game:FindService("StarterGui"):SetCore("ResetButtonCallback", false)
I could instead use game:GetService("Players"):GetPlayerFromCharacter(hit.Parent).PlayerGui:SetCore("resetButtonCallback, false)
so that I can target the arrested victim?
Ok let me understand:
game:GetService("Players"):GetPlayerFromCharacter(hit.Parent).PlayerGui:SetCore("resetButtonCallback", false)
Yeah i guess you can, if that doesn’t works then you can create a IntValue to every player (Arrested) and if it’s 1 then the reset button will be disabled:
local Arrested = game.Players.LocalPlayer:FindFirstChild("Arrested")
while wait() do
if Arrested.Value == 1 then
game:FindService("StarterGui"):SetCore("ResetButtonCallback", false)
else
game:FindService("StarterGui"):SetCore("ResetButtonCallback", true)
end
end
Set this as a local script.
Perfect, thank you for the solution.
I wouldn’t really advise abusing loops for this scenario; you don’t have a need to loop here at all. Setting ResetButtonCallback once should be enough.
Something else you can do is to have the server clamp the cuffed victim’s health to their current health. The reset button sets the health to 0 so preventing health changes of a 0 value would be sufficient.
Also - no to while wait.
Yeah! i forgot about that post, well i should never use while do? he can use instead:
while Arrested.Value == 1 do
…i guess, i’m not professional on that, or the “Repeat/until” statement.