Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local DataStore2 = require(game.ServerScriptService:WaitForChild('DataStore2'))
- local function checkAssets(plr)
- local Asset_Id = 000000000
- local markerplaceservice = game:GetService('MarketplaceService')
- local ownsasset = markerplaceservice.PlayerOwnsAsset
- local success, playerownsasset = pcall(ownsasset, markerplaceservice, plr, Asset_Id)
- if playerownsasset then
- print('Player Owns Asset.')
- return true
- else
- warn('Player does not own Asset.')
- end
- end
- -- // [[
- local rs = game:GetService('ReplicatedStorage')
- local remotefolder = rs:FindFirstChild('Remotes')
- local bountytrigger = remotefolder:FindFirstChild('Bounty')
- local claimbounty = remotefolder:FindFirstChild('Claim')
- local toll = remotefolder:FindFirstChild('PayToll')
- local eventtrigger = remotefolder:FindFirstChild('EventTrigger')
- local teleporttrigger = remotefolder:FindFirstChild('TeleportTrigger')
- local blackmarkettrigger = remotefolder:FindFirstChild('BlackMarket')
- local eventModule = require(rs.Resources.Events)
- local function sendbountyinfo(plr, target, val)
- local coinstore = DataStore2('ZetaCredit', plr)
- if game.Players:FindFirstChild(target)then
- local player = game.Players:FindFirstChild(target)
- local bountystore = DataStore2('ZetaBounty', player)
- if val <= coinstore:Get()then
- coinstore:Increment(-val)
- bountystore:Increment(val)
- end
- end
- end
- local function claimTac(plr, event, target)
- if event == 'INFO' then
- print('SERVER CHECK')
- claimbounty:FireClient(plr, checkAssets(plr))
- --[[elseif event == 'CLAIM' then
- if game.Players:FindFirstChild(target) then
- local claimTarget = game.Players:FindFirstChild(target)
- local claim = game.Players:FindFirstChild(plr.Name)
- local charTarget = game.Workspace:FindFirstChild(claimTarget.Name)
- local bountystore = DataStore2('ZetaBounty', claimTarget)
- local coinstore = DataStore2('ZetaCredit', claim)
- local bountycollectstore = DataStore2('ZetaBountyClaim', claim)
- local bountyaccumulated = DataStore2('ZetaBountyAccumulate', claim)
- coinstore:Increment(bountystore:Get())
- bountyaccumulated:Increment(bountystore:Get())
- bountystore:Increment(-bountystore:Get())
- bountycollectstore:Increment(1)
- claimTarget:LoadCharacter()
- end]]
- end
- end
- local function PayToll(plr, city)
- local player = game.Players:FindFirstChild(plr.Name)
- local coinstore = DataStore2('ZetaCredit', player)
- coinstore:Increment(-10)
- player.PlayerGui.TeleportGui.Enabled = true
- teleporttrigger:FireClient(plr, city)
- end
- local function EventCheck(plr, FORM, EventId)
- local m = eventModule.Events
- local InEvent = plr.Bools.InEvent
- local Completed = plr.Bools.IsComplete
- if game.Players:FindFirstChild(plr.Name)then
- if FORM == 'CHECK' then
- local folder = plr:FindFirstChild(m[EventId]['NAME'])
- local count = folder:FindFirstChild(m[EventId]['GOAL'])
- local goal = folder:FindFirstChild('Goal')
- local coinstore = DataStore2('ZetaCredit', plr)
- if count.Value >= goal.Value then
- print('CHECK TRUE')
- Completed.Value = true
- folder:Destroy()
- InEvent.Value = false
- coinstore:Increment(m[EventId]['PAY'])
- else
- print('CHECK FALSE')
- Completed.Value = false
- end
- end
- if FORM == 'REGISTER'then
- eventtrigger:FireClient(plr, EventId)
- print('CHECK')
- InEvent.Value = true
- Completed.Value = false
- local folder = Instance.new('Folder', plr)
- folder.Name = m[EventId]['NAME']
- local count = Instance.new('IntValue', folder)
- count.Name = m[EventId]['GOAL']
- count.Value = 0
- local goal = Instance.new('IntValue', folder)
- goal.Name = 'Goal'
- goal.Value = m[EventId]['AMOUNT']
- end
- end
- end
- local function teleport(plr, destination)
- local player = game.Players:FindFirstChild(plr.Name)
- local char = player.Character
- local locations = game.Workspace:FindFirstChild('EventLocations'):FindFirstChild('Teleport')
- if locations:FindFirstChild(destination)then
- char.Torso.CFrame = locations[destination].CFrame
- end
- wait(3)
- player.PlayerGui.TeleportGui.Enabled = false
- end
- local function blackmarket(plr, call, item)
- local player = game.Players:FindFirstChild(plr.Name)
- local char = player.Character
- local location = game.Workspace:FindFirstChild('BlackmarketFolder'):WaitForChild('Center')
- if call == 'OPEN' then
- if (location.Position - char.Torso.Position).magnitude < 100 then
- player.PlayerGui.Blackmarket.Enabled = true
- end
- end
- if call == 'EXIT' then
- player.PlayerGui.Blackmarket.Enabled = false
- end
- if call == 'PURCHASE' then
- local m = require(rs.Resources.Blackmarket)
- local coinstore = DataStore2('ZetaCredit', player)
- if coinstore:Get() >= m.Items[item]['price'] then
- coinstore:Increment(m.Items[item]['deduct'])
- local tool = game:GetService('ServerStorage'):FindFirstChild(item):Clone()
- tool.Parent = plr.Backpack
- end
- end
- end
- bountytrigger.OnServerEvent:Connect(sendbountyinfo)
- claimbounty.OnServerEvent:Connect(claimTac)
- toll.OnServerEvent:Connect(PayToll)
- eventtrigger.OnServerEvent:Connect(EventCheck)
- teleporttrigger.OnServerEvent:Connect(teleport)
- blackmarkettrigger.OnServerEvent:Connect(blackmarket)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement