Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local HatEvent = ReplicatedStorage:WaitForChild("HatEvent")
- local MarketplaceService = game:GetService("MarketplaceService")
- HatEvent.OnServerEvent:Connect(function(player, hat, Type)
- local Hat = ReplicatedStorage:WaitForChild(hat):Clone()
- if Type == "Equip" then
- Hat.Parent = player.Character
- elseif Type == "Unequip" then
- player.Character[hat]:Destroy()
- else
- player:Kick()
- end
- end)
- MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, purchasedPassID, purchaseSuccess)
- if purchaseSuccess then
- HatEvent:FireClient(purchasedPassID)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement