Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Lighting = game:GetService("Lighting")
- local MarketplaceService = game:GetService("MarketplaceService")
- local Players = game:GetService("Players")
- local gamepassId = 00000 --Put the ID of the asset here
- local toolNames = {"Potion"} --Must be in lighting --Name Of Item
- local toolsParent = Lighting
- local function onPlayerAdded(player)
- local function onCharacterAdded(character)
- if MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamepassId) then
- for i = 1, #toolNames do
- local tool = toolsParent:FindFirstChild(toolNames[i])
- if tool then
- local clone = tool:Clone()
- clone.Parent = player.Backpack
- end
- end
- end
- end
- if player.Character then
- onCharacterAdded(player.Character)
- end
- player.CharacterAdded:Connect(onCharacterAdded)
- end
- Players.PlayerAdded:Connect(onPlayerAdded)
- --Credit:Dev_LandonRB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement