Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Giver involving game pass won't work. What seems to be the problem?

local passId =  389372345 -- Change this to your game pass' ID
local GPS = game:GetService("GamePassService")
local lighting = game.Lighting
local l86  = {lighting.L86, lighting.GL86}

script.Parent.Touched:connect(function(part)
if game.Players:FindFirstChild(part.Parent.Name) then
local player  = game.Players[part.Parent.Name]
if GPS:PlayerHasPass(player, passId)  then
if not player.Backpack[l86[2].Name] or player.StarterGear[l86[2].Name] then
l86[2]:Clone().Parent = player.Backpack
l86[2]:Clone().Parent = player.StarterGear
end
else
 if not player.Backpack[l86[1].Name] and player.StarterGear[l86[1].Name] then
l86[1]:Clone().Parent = player.Backpack
l86[1]:Clone().Parent = player.StarterGear
end
end
end
end)

The id is correct. Nothing seems to be showing the problem

1 answer

✓ Accepted answer

Let me know if this works out for you...

local passId =  232021112 -- Change this to your game pass' ID
local GPS = game:GetService("GamePassService")
local lighting = game.Lighting
local l86  = {lighting.L86, lighting.GL86}

script.Parent.Touched:connect(function(part)
if game.Players:FindFirstChild(part.Parent.Name) then
local player  = game.Players[part.Parent.Name]
if GPS:PlayerHasPass(player, passId)  then
if player.Backpack:FindFirstChild(l86[2].Name)==nil or player.StarterGear:FindFirstChild(l86[2].Name)==nil then
l86[2]:Clone().Parent = player.Backpack
l86[2]:Clone().Parent = player.StarterGear
else
 if player.Backpack:FindFirstChild(l86[1].Name)==nil and player.StarterGear:FindFirstChild(l86[1].Name)==nil then
l86[1]:Clone().Parent = player.Backpack
l86[1]:Clone().Parent = player.StarterGear
end
end
end
end
end)

2 comments

0

Yes thank you so much!

0

Not a problem!

This discussion is preserved as it was. New answers, comments, and votes are closed.