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

Game pass can only be queried by Script on ROBLOX game server?

Asked by 8 years ago
Edited 8 years ago

I'm trying convert this over to LocalScript but it isn't working:

                    if c.Vip_Suit.VipType.Value == 1 and GPS:PlayerHasPass(p, script.Parent.Rex.Value) then
for _,v in pairs(game.ReplicatedStorage.Game_Tools[c.Vip_Suit.Tool.Value]:GetChildren()) do
if v:IsA("HopperBin") or v:IsA("Tool") then
v:clone().Parent = p.Backpack
end end end 

if c.Vip_Suit.VipType.Value == 2 and GPS:PlayerHasPass(p, script.Parent.Sat.Value) then
for _,v in pairs(game.ReplicatedStorage.Game_Tools[c.Vip_Suit.Tool.Value]:GetChildren()) do
if v:IsA("HopperBin") or v:IsA("Tool") then
v:clone().Parent = p.Backpack
end end end 

if c.Vip_Suit.VipType.Value == 3 and GPS:PlayerHasPass(p, script.Parent.Fusion.Value) then
for _,v in pairs(game.ReplicatedStorage.Game_Tools[c.Vip_Suit.Tool.Value]:GetChildren()) do
if v:IsA("HopperBin") or v:IsA("Tool") then
v:clone().Parent = p.Backpack
end end end 

if c.Vip_Suit.VipType.Value == 4 and GPS:PlayerHasPass(p, script.Parent.Rex.Value) and GPS:PlayerHasPass(p, script.Parent.Sat.Value) then
for _,v in pairs(game.ReplicatedStorage.Game_Tools[c.Vip_Suit.Tool.Value]:GetChildren()) do
if v:IsA("HopperBin") or v:IsA("Tool") then
v:clone().Parent = p.Backpack
end end end 

but it is still giving me the error "Game passes can only be queried by a Script running on a ROBLOX game server"

This is at the top of the main script: (where it's looking for the service)

local GPS = Game:GetService("GamePassService")

Is there something wrong with that part instead?

1
GamePassService can not be used via LocalScript. Might I recommend MarketPlaceService's PlayerOwnsAsset instead? M39a9am3R 3210 — 8y
0
It is recommend that you use PlayerOwnsAsset as it gets the live results from the website and other reasons, http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PlayerOwnsAsset User#5423 17 — 8y

Answer this question