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 |
02 | for _,v in pairs (game.ReplicatedStorage.Game_Tools [ c.Vip_Suit.Tool.Value ] :GetChildren()) do |
03 | if v:IsA( "HopperBin" ) or v:IsA( "Tool" ) then |
04 | v:clone().Parent = p.Backpack |
07 | if c.Vip_Suit.VipType.Value = = 2 and GPS:PlayerHasPass(p, script.Parent.Sat.Value) then |
08 | for _,v in pairs (game.ReplicatedStorage.Game_Tools [ c.Vip_Suit.Tool.Value ] :GetChildren()) do |
09 | if v:IsA( "HopperBin" ) or v:IsA( "Tool" ) then |
10 | v:clone().Parent = p.Backpack |
13 | if c.Vip_Suit.VipType.Value = = 3 and GPS:PlayerHasPass(p, script.Parent.Fusion.Value) then |
14 | for _,v in pairs (game.ReplicatedStorage.Game_Tools [ c.Vip_Suit.Tool.Value ] :GetChildren()) do |
15 | if v:IsA( "HopperBin" ) or v:IsA( "Tool" ) then |
16 | v:clone().Parent = p.Backpack |
19 | if c.Vip_Suit.VipType.Value = = 4 and GPS:PlayerHasPass(p, script.Parent.Rex.Value) and GPS:PlayerHasPass(p, script.Parent.Sat.Value) then |
20 | for _,v in pairs (game.ReplicatedStorage.Game_Tools [ c.Vip_Suit.Tool.Value ] :GetChildren()) do |
21 | if v:IsA( "HopperBin" ) or v:IsA( "Tool" ) then |
22 | v:clone().Parent = p.Backpack |
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)
1 | local GPS = Game:GetService( "GamePassService" ) |
Is there something wrong with that part instead?