Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 8 years ago
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

Log in to vote
0
Answered by 8 years ago

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)
0
Yes thank you so much! Supergamerboy1995 129 — 8y
0
Not a problem! TealTeam 40 — 8y
Ad

Answer this question