Advertisement
Sungmingamerpro13

Weapons Shop(LocalScript)

Jun 27th, 2023 (edited)
1,050
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.09 KB | None | 0 0
  1. local WeaponsEvent = game.ReplicatedStorage.BuyEvents
  2. local WeaponsFrame = script.Parent.WeaponsFrame
  3.  
  4. local player = game.Players.LocalPlayer
  5. local GamepassId = 196525745
  6.  
  7. WeaponsFrame.Exit.MouseButton1Click:Connect(function()
  8.     WeaponsFrame:TweenPosition(UDim2.new(0.5,0,-1,0),.1)
  9. end)
  10.  
  11. WeaponsFrame.BatButton.MouseButton1Click:Connect(function()
  12.     WeaponsEvent.BatEvent:FireServer(player)
  13.    
  14.     player.Backpack:ClearAllChildren()
  15. end)
  16.  
  17. WeaponsFrame.PremiumButton.MouseButton1Click:Connect(function()
  18.     if player.MembershipType == Enum.MembershipType.Premium then
  19.         WeaponsEvent.PremiumEvent:FireServer(player)
  20.        
  21.         player.Backpack:ClearAllChildren()
  22.     end
  23. end)
  24.  
  25. WeaponsFrame.DemonSwordButton.MouseButton1Click:Connect(function()
  26.     if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, GamepassId) then
  27.         WeaponsEvent.DemonSword:FireServer(player)
  28.  
  29.         player.Backpack:ClearAllChildren()
  30.     elseif player.Coins.Value >= 100 then
  31.         player.Coins.Value = player.Coins.Value - 100
  32.         WeaponsEvent.DemonSword:FireServer(player)
  33.  
  34.         player.Backpack:ClearAllChildren()
  35.     end
  36. end)
  37.  
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement