#Help
1 messages · Page 1 of 1 (latest)
There's no variable for GamePassService.
uh yeah?
uhh
you can edit studio my game turn on third party sale in settings, security pls bro
i forgot what that is
What the hell are you talking about
and how to add
What a variable is...?
yep
local GAMEPASS_ID = 7464489249
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SpawnItemEvent = ReplicatedStorage:WaitForChild("SpawnCar2") -- Change this to your remoteevent name
local Debounce = false
local function checkGamePass()
local player = game.Players.LocalPlayer
if GamePassService:PlayerHasPass(player, GAMEPASS_ID) then
print(player.Name .. " has the game pass!")
if not Debounce then
Debounce = true
SpawnItemEvent:FireServer()
wait(5)
Debounce = false
end
else
print(player.Name .. " doesn't have the game pass...")
end
end
script.Parent.MouseButton1Click:Connect(function()
checkGamePass()
end)

but you made multiple variables in this script
its a freemodel
what is?
Please don't go into unrelated forum posts to ask people to do things for you
ok chill
yo u have pc?
how would I set it up?
How did you write this script if you can't write variables
Those are very much "variables", not "locals", just to keep terminology clear
ok
** You are now Level 4! **
im new so im still learning what everything is
You are trying to access PlayerHasPass directly from a LocalScript bro.
GamePassService is a service like ReplicatedStorage, so get it in the same way
you need to use a remote event to communicate with the server and check the Gamepass on the server side
That code is AI
local GamePassService= game:GetService("GamePassService")
No wonder this guy doesn't know what he is doing
is that right?
so i just add that
where you get the other services yes
it aint, I tryed hard
It's so obvious man
whatever
🤦♂️
???
Yep that's fine. See how that redline under GamePassService went away?
Good luck
@wraith sentinel
uhh
local GAMEPASS_ID = 7464489249
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SpawnItemEvent = ReplicatedStorage:WaitForChild("SpawnCar2") -- Change this to your remoteevent name
local Debounce = false
local GamePassService= game:GetService("GamePassService")
local function checkGamePass()
local player = game.Players.LocalPlayer
if GamePassService:PlayerHasPass(player, GAMEPASS_ID) then
print(player.Name .. " has the game pass!")
if not Debounce then
Debounce = true
SpawnItemEvent:FireServer()
wait(5)
Debounce = false
end
else
print(player.Name .. " doesn't have the game pass...")
end
end
script.Parent.MouseButton1Click:Connect(function()
checkGamePass()
end)
How do i add t5hat
it explains the problem but not very detailted on how to fix
How about you read this a bit:
https://create.roblox.com/docs/production/monetization/game-passes
It'll explain everything from start to finish
i read a bit and is this right?
Nope, because that red line means it can't find MarketplaceService, because you didn't get the service and put it into a variable
That wasn't what I said
but you can change that
I didn't think you still had the other variable
Did the thing I linked say you needed it?
Okay so you did something wrong, try reading the linked article again.
Show me the line the error points to.
It tells you all the code you need, there was a part about checking if the player owns it even
Click on the error.
You see how it says LocalScript:10? That means in the script called "LocalScript", line 10
** You are now Level 5! **
Because you're already in the script the error is in I guess.
Please re-read the doc I sent you. I feel like you skimmed it.
You use player.UserId, not just player
are you sure this can be done on a local script
also why doesnt it just fire the server and the server determines that anyway
i think so
right now anyone can just fire that remote event and get a meme car for free
after almost a year of looking at that passes documentation thing. I still dont know what to do... @reef stone
Okay, what part are you not understanding?
Maybe you need to re-write it then?
:/
fine
@reef stone I am so sorry for the problems I have caused you... I found out roblox glitched and gave me the wrong asset ID. That was the problem all along
lol that's unfortunate, glad it was simple
ye