Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Datastore = game:GetService("DataStoreService")
- local PointsValue = Datastore:GetDataStore("PointsSaved")
- local MarketPlaceService = game:GetService("MarketplaceService")
- local Events = game.ReplicatedStorage.GiveSystem
- local Pending = {}
- -- Give Item
- Events.GiveItems.OnServerEvent:Connect(function(From, To, Items)
- if From:GetRankInGroup(5698560) >=5 then
- local ValidItems = {}
- local text = From.Name.." sent "
- for _, Item in pairs(Items) do
- if game.ReplicatedStorage.AdminFolder.ServerValidateTool:Invoke(From, Item) then
- table.insert(ValidItems, Item)
- text = text..Item.Name..", "
- Item.Parent = nil
- else
- game.ReplicatedStorage.AdminFolder.ServerReportExploit:Fire(From, "Trying to send "..Item.Name.." to "..To.Name".")
- end
- end
- if From == To then
- game.ReplicatedStorage.AdminFolder.ServerReportExploit:Fire(From, "Attempt to give items to themselves.")
- else
- local Gui = script.RecieveItem:Clone()
- Gui.From.Value = From
- local id = #Pending + 1
- Pending[id] = ValidItems
- Gui.ItemGroupId.Value = id
- Gui.Frame.Question.Text = "Would you like to recieve "..#ValidItems.."items from "..From:GetRoleInGroup(4464296)..", "..From.Name.."?"
- Gui.Parent = To.PlayerGui
- game.ReplicatedStorage.AdminFolder.GiveLog:Fire(text:sub(1, -3).." to "..To.Name)
- end
- end
- end)
- -- Add point
- Events.AcceptItems.OnServerEvent:Connect(function(From, Target, id)
- if Target:GetRankInGroup(5698560) >= 5 then
- local text = From.Name.." accepted "
- for _, Item in pairs(Pending[id]) do
- text = text..Item.Name..", "
- Item.Parent = From.Backpack
- end
- Target.leaderstats.Points.Value = Target.leaderstats.Points.Value+1
- Pending[id] = nil
- game.ReplicatedStorage.AdminFolder.GiveLog:Fire(text:sub(1, -3).." from "..Target.Name)
- end
- end)
- -- Revoke point
- Events.RefuseItems.OnServerEvent:Connect(function(From, Target, id)
- if Target:GetRankInGroup(5698560) >= 5 then
- local text = From.Name.." refused "
- for _, Item in pairs(Pending[id]) do
- text = text..Item.Name..", "
- Item.Parent = Target.Backpack
- end
- Pending[id] = nil
- game.ReplicatedStorage.AdminFolder.GiveLog:Fire(text:sub(1, -3).." from "..Target.Name)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement