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

Gamepass not working?

Asked by 10 years ago
local BallButton = script.Parent
local player = game.Players.LocalPlayer

BallButton:findFirstChild("Reg").MouseButton1Click:connect(function()
 game.Workspace.ValueFile.BallType.Value = 0
end)

BallButton:findFirstChild("Blue").MouseButton1Click:connect(function()
 if game:GetService("GamePassService"):PlayerHasPass(player, 159205131) then
 game.Workspace.ValueFile.BallType.Value = 1
 end
end)

BallButton:findFirstChild("Red").MouseButton1Click:connect(function()
 if game:GetService("GamePassService"):PlayerHasPass(player, 159602182) then
 game.Workspace.ValueFile.BallType.Value = 2
 end
end)

Why does it print (Game passes can only be queried by a Script running on a ROBLOX game server) in a game server

I cannot figure out this error.

3 answers

Log in to vote
0
Answered by 10 years ago

The gamepass and the script might be working fine. Unfortunately, you can't test GamePasses in Roblox Studio. You have to actually be playing the game for the service to start.

0
Yes, thats where I've been testing. YellowoTide 1992 — 10y
Ad
Log in to vote
0
Answered by
LostPast 253 Moderation Voter
10 years ago

This is not an answer;

This script was tested in game with roblox play and it gave a response like it usually only would on studio... I am part of Yellow's Dev team so I was clearing some things up.... I hope this helps people answer this problem.

The output is strange because it should only print this in studio test but it is doing this in a real server with real accounts... Please help!

0
Found the answer! U didn't find the userId LostPast 253 — 10y
Log in to vote
-2
Answered by 10 years ago

What's the gamepass meant for?

0
A new in game item you can use YellowoTide 1992 — 10y

Answer this question