game.Players.PlayerAdded:connect(function(plr)
if plr:WaitForDataReady() then
local v = Instance.new("IntValue")
v.Name = "Arrested"
v.Parent = plr
plr.Arrested.Value = plr:LoadNumber("ArrestedV")
if plr.Arrested.Value > 0 then
plr.TeamColor = BrickColor.new("New Yeller")
plr:LoadCharacter()
end
plr.ChildAdded:connect(function(c)
if c.Name == "Arrested1" then
plr.TeamColor = BrickColor.new("New Yeller")
plr:LoadCharacter()
if plr.PlayerGui:FindFirstChild("MainFrame") then
plr.PlayerGui:FindFirstChild("MainFrame").Control.Visible = false
end
for i,v in pairs(plr.Backpack:GetChildren()) do
if v:IsA("Tool") or v:IsA("HopperBin") then
v:Destroy()
end
end
end
end)
end
end)
while true do
wait(1)
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor == BrickColor.new("New Yeller") then
v.Arrested.Value = v.Arrested.Value - 1
v:SaveNumber("ArrestedV", v.Arrested.Value)
if v.Arrested.Value < 0 then
v:SaveNumber("ArrestedV", v.Arrested.Value)
v.TeamColor = BrickColor.new("White")
v:LoadCharacter()
end
end
end
end
This manages my arresting system, which I think is the right one, I want it to check their team. If Their on “Inmate” or New Yeller team, it will not allow them to open my Menu GUI(Frame). Please help with this! If you want any other scripts from my handcuff to view. Feel free, but, from my feeling it seems that it should be a Loop in ServerScriptService checking if the player is on team “Inmate”/New Yeller, if they are it destroys Menu Frame. But, I don’t know how to do that.
I got the Scripts for Handcuffs from YT Videos and combined them, it works amazing now! Just I want help with this. Thank you…
A Inmate gets arressted, they can simply change their team to Citizen without fear if a Moderator is online. I want to fix the issue by deleting the Menu GUI allowing them to not change teams, but on other teamss it makes the menu visible again. So basically making Menu GUI 1 Transparency when their on Inmate team, and when their on any other teams it’s 0 Transparency.
Is the issue not that you are looking to see if the intvalue u put in name is “Arrested1” but you call it “Arrested” ? So the if statement does not run the stuff inside where it makes the UI not visible because it is not called Arrested1.
Nope, not the issue. It won’t delete the menu for some reason.
game.Players.PlayerAdded:connect(function(plr)
if plr:WaitForDataReady() then
local v = Instance.new("IntValue")
v.Name = "Arrested"
v.Parent = plr
plr.Arrested.Value = plr:LoadNumber("ArrestedV")
if plr.Arrested.Value > 0 then
plr.TeamColor = BrickColor.new("New Yeller")
plr:LoadCharacter()
end
plr.ChildAdded:connect(function(c)
if c.Name == "Arrested1" then
plr.TeamColor = BrickColor.new("New Yeller")
plr:LoadCharacter()
if plr.PlayerGui:FindFirstChild("Menu") then
plr.PlayerGui:FindFirstChild("Menu").Visible = false
end
for i,v in pairs(plr.Backpack:GetChildren()) do
if v:IsA("Tool") or v:IsA("HopperBin") then
v:Destroy()
end
end
end
end)
end
end)
while true do
wait(1)
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor == BrickColor.new("New Yeller") then
v.Arrested.Value = v.Arrested.Value - 1
v:SaveNumber("ArrestedV", v.Arrested.Value)
if v.Arrested.Value < 0 then
v:SaveNumber("ArrestedV", v.Arrested.Value)
v.TeamColor = BrickColor.new("White")
v:LoadCharacter()
end
end
end
end