Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mps = game:GetService("MarketplaceService")
- local devid = script.Parent.DevProductId.Value
- mps.ProcessReceipt = function(receiptinfo)
- if receiptinfo.ProductId == devid then
- local player = game.Players:GetPlayerByUserId(receiptinfo.PlayerId)
- local bool = Instance.new("BoolValue")
- bool.Name = player.Name
- bool.Parent = script
- game.ReplicatedStorage.DevDoorServerRemotes.Bought:FireClient(player)
- end
- end
- game.ReplicatedStorage.DevDoorServerRemotes.Check.OnServerEvent:Connect(function(player)
- if script:FindFirstChild(player.Name) then
- print("GO")
- else
- game.ReplicatedStorage.DevDoorServerRemotes.ReturnCheck:FireClient(player)
- end
- end)
- game.Players.PlayerRemoving:Connect(function(player)
- if script:FindFirstChild(player.Name) then
- script:FindFirstChild(player.Name):Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement