Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sendCall = game.ReplicatedStorage.Remotes.sendCall
- local acceptCall = game.ReplicatedStorage.Remotes.acceptCall
- local count = 0
- function createCall(parent, txt)
- local CallTxt = Instance.new("TextLabel")
- local AcceptBtn = Instance.new("TextButton")
- CallTxt.Name = "Call"..tostring(count)
- CallTxt.Parent = parent
- CallTxt.Active = true
- CallTxt.BackgroundColor3 = Color3.new(0, 0.666667, 1)
- CallTxt.BorderSizePixel = 0
- CallTxt.Position = UDim2.new(1.70679968e-08, 0, 0, 0)
- CallTxt.Size = UDim2.new(0.699999988, 0, 0.00200000009, 0)
- CallTxt.Font = Enum.Font.SourceSansBold
- CallTxt.Text = tostring(txt)
- CallTxt.TextColor3 = Color3.new(1, 1, 1)
- CallTxt.TextSize = 14
- AcceptBtn.Name = "Accept"
- AcceptBtn.Parent = CallTxt
- AcceptBtn.BackgroundColor3 = Color3.new(0, 0.666667, 0)
- AcceptBtn.BorderSizePixel = 0
- AcceptBtn.Position = UDim2.new(0.997123718, 0, 0, 0)
- AcceptBtn.Size = UDim2.new(0.412272304, 0, 0.999999464, 0)
- AcceptBtn.AutoButtonColor = false
- AcceptBtn.Font = Enum.Font.SourceSansBold
- AcceptBtn.Text = "Accept"
- AcceptBtn.TextColor3 = Color3.new(1, 1, 1)
- AcceptBtn.TextSize = 14
- AcceptBtn.MouseButton1Click:Connect(function()
- for i, v in pairs(game.Players:GetChildren()) do
- if v.Team.Name == "Police" then
- if AcceptBtn.Text ~= "Accepted" then
- acceptCall:FireClient(v, "Call"..tostring(string.sub(AcceptBtn.Parent.Name, 5)))
- v.PlayerGui.CallDatabase.MainFrame.CallHolder["Call"..tostring(string.sub(AcceptBtn.Parent.Name, 5))].Accept.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
- v.PlayerGui.CallDatabase.MainFrame.CallHolder["Call"..tostring(string.sub(AcceptBtn.Parent.Name, 5))].Accept.Text = "Accepted"
- end
- end
- end
- end)
- count = count + 1
- end
- sendCall.OnServerEvent:Connect(function(plr, call)
- for i, v in pairs(game.Players:GetChildren()) do
- if v.Team.Name == "Police" then
- createCall(v.PlayerGui.CallDatabase.MainFrame.CallHolder, call)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement