This script is inside an brick, how do I make this work when you click the brick?
local Cooldown = false
script.Parent.RemoteEvent.OnServerEvent:Connect(function(Player)
if Cooldown == true then return end
if Player:IsInGroup(script.Parent.IsRestricted.Value) then
if not Player.PlayerGui:FindFirstChild('NYPDBookPlayer') then
if Player.Backpack:FindFirstChild('Grab') then
if Player.Backpack.Grab.Suspect.Value then
if game.Players:FindFirstChild(Player.Backpack.Grab.Suspect.Value) then
local Gui = game.ServerStorage.NYPDBookPlayer:Clone()
Gui.Parent = Player.PlayerGui
Gui.Suspect.Value = game.Players:FindFirstChild(Player.Backpack.Grab.Suspect.Value)
end
end
end
end
end
Cooldown = false
end)

2 comments
Forgot to mention it also has an remote event and is restricted value inside teh brick
The brick*