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:

01                    if c.Vip_Suit.VipType.Value == 1 and GPS:PlayerHasPass(p, script.Parent.Rex.Value) then
02for _,v in pairs(game.ReplicatedStorage.Game_Tools[c.Vip_Suit.Tool.Value]:GetChildren()) do
03if v:IsA("HopperBin") or v:IsA("Tool") then
04v:clone().Parent = p.Backpack
05end end end
06 
07if c.Vip_Suit.VipType.Value == 2 and GPS:PlayerHasPass(p, script.Parent.Sat.Value) then
08for _,v in pairs(game.ReplicatedStorage.Game_Tools[c.Vip_Suit.Tool.Value]:GetChildren()) do
09if v:IsA("HopperBin") or v:IsA("Tool") then
10v:clone().Parent = p.Backpack
11end end end
12 
13if c.Vip_Suit.VipType.Value == 3 and GPS:PlayerHasPass(p, script.Parent.Fusion.Value) then
14for _,v in pairs(game.ReplicatedStorage.Game_Tools[c.Vip_Suit.Tool.Value]:GetChildren()) do
15if v:IsA("HopperBin") or v:IsA("Tool") then
View all 23 lines...

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)

1local 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