Hello! So I am trying to make a script like in Jailbreak SWAT team, so if you click the gun. at a wall then if u do not own the gamepass then you do not get it in your inventory if you do u go it.
I am a beginner scripter and I tried doing this, if you can help me please write. Thanks.
local gamepassId = 11378351 local tool = game.ReplicatedStorage:FindFirstChild("The Little Friend"):Clone()
script.Parent.ClickDetector.MouseClick:Connect(function(player) if gamepassId:UserOwnsGamePassAsync(player.UserId, gamepassId) then tool.Parent = player.Backpack for _,two in pairs(tool:GetChildren()) do if two:IsA ("LocalScript") then two.Disabled = false wait() else print(2) end end end end)

1 comment
You can click the little 'view source' button (appears when you hover over the code) to copy it.