Advertisement
qsenko1

WorkingServersiteGamepassCheck

May 7th, 2021
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.46 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local debounce = true
  3. local player = Players.LocalPlayer
  4. local ReplicateStorage = game:GetService("ReplicatedStorage")
  5. local GravityCoilEvenent = ReplicateStorage:WaitForChild("GamePassEvents"):WaitForChild("GravityCoilEvent")
  6. local GravityCoilDestroy = ReplicateStorage:WaitForChild("GamePassEvents"):WaitForChild("GravityCoilDestroy")
  7.  
  8. local function GravityCoilCheck(player)
  9.     local ownsGamepass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,17603127)   
  10.     local Coil = player.Backpack:FindFirstChild("GravityCoil")
  11.     local Coil2 = player.StarterGear:FindFirstChild("GravityCoil")
  12.     if ownsGamepass and not Coil and not Coil2 then
  13.         debounce = false
  14.         --print("Cloning")
  15.     local GravityCoil = game:GetService("ReplicatedStorage").GamepassItems:FindFirstChild("GravityCoil"):Clone()
  16.     local GravityCoil2 = game:GetService("ReplicatedStorage").GamepassItems:FindFirstChild("GravityCoil"):Clone()
  17.  
  18.         GravityCoil.Parent = player.Backpack   
  19.         GravityCoil2.Parent = player.StarterGear
  20.         wait(1.5)
  21.         debounce = true
  22.     return
  23. end
  24.     if ownsGamepass and player.StarterGear:FindFirstChild("GravityCoil") or player.Backpack:FindFirstChild("GravityCoil") then
  25.         local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
  26.         if humanoid then
  27.             debounce = false
  28.             --print("Destroying")
  29.             humanoid:UnequipTools()
  30.             player.Character.Humanoid:UnequipTools()
  31.             wait(0.1)
  32.             GravityCoilDestroy:FireServer()
  33.             -- player.Backpack:FindFirstChild("GravityCoil"):Destroy()
  34.             --  player.StarterGear:FindFirstChild("GravityCoil"):Destroy() 
  35.             wait(1.5)
  36.             debounce = true
  37.             return
  38.         end
  39.     end
  40. end
  41.    
  42. GravityCoilEvenent.OnServerEvent:Connect(GravityCoilCheck)
  43.  
  44. local function GravityCoilDestroy2(player)
  45.     local ownsGamepass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,17603127)if ownsGamepass and player.StarterGear:FindFirstChild("GravityCoil") or player.Backpack:FindFirstChild("GravityCoil") then         
  46.     local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
  47.     if humanoid then
  48.         debounce = false
  49.         --print("Destroying")
  50.         humanoid:UnequipTools()
  51.         player.Character.Humanoid:UnequipTools()
  52.         wait(0.1)
  53.         player.Backpack:FindFirstChild("GravityCoil"):Destroy()
  54.         player.StarterGear:FindFirstChild("GravityCoil"):Destroy() 
  55.         debounce = true
  56.             return
  57.         else
  58.             return
  59.        end
  60.     end
  61. end
  62.  
  63. GravityCoilDestroy.OnServerEvent:Connect(GravityCoilDestroy2)
  64.  
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement