#Help

1 messages · Page 1 of 1 (latest)

wraith sentinel
#

My code is not working and I dont know why...

reef stone
jagged robin
#

moontune

reef stone
wraith sentinel
jagged robin
wraith sentinel
reef stone
wraith sentinel
#

and how to add

reef stone
wraith sentinel
#

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)

jagged robin
reef stone
glass knoll
#

its a freemodel

wraith sentinel
reef stone
jagged robin
wraith sentinel
reef stone
wraith sentinel
#

I call them locals

#

not variables

#

so confuion

#

my spelling :/

reef stone
wraith sentinel
#

ok

serene girderBOT
#

studio** You are now Level 4! **studio

wraith sentinel
#

im new so im still learning what everything is

scarlet pasture
reef stone
scarlet pasture
#

you need to use a remote event to communicate with the server and check the Gamepass on the server side

acoustic gust
#

That code is AI

wraith sentinel
#

local GamePassService= game:GetService("GamePassService")

acoustic gust
#

No wonder this guy doesn't know what he is doing

wraith sentinel
#

is that right?

wraith sentinel
#

so i just add that

reef stone
wraith sentinel
acoustic gust
#

It's so obvious man

wraith sentinel
acoustic gust
#

🤦‍♂️

wraith sentinel
reef stone
wraith sentinel
#

yes

#

thanks very much

#

ill get the pass and test it now

reef stone
wraith sentinel
#

@reef stone

reef stone
#

@wraith sentinel

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

reef stone
wraith sentinel
reef stone
# wraith sentinel

Nope, because that red line means it can't find MarketplaceService, because you didn't get the service and put it into a variable

wraith sentinel
#

change gamepass service to marketplace service?

#

@reef stone

reef stone
#

but you can change that

#

I didn't think you still had the other variable

wraith sentinel
#

do I need gamepass service?

#

@reef stone

reef stone
wraith sentinel
#

i did not know what I was looking for

#

@reef stone ???

reef stone
# wraith sentinel

Okay so you did something wrong, try reading the linked article again.

wraith sentinel
#

what part in it?

#

all the link is is how to make a pass and sell it

reef stone
reef stone
wraith sentinel
#

i dont know what line it is pointing to...

reef stone
#

You see how it says LocalScript:10? That means in the script called "LocalScript", line 10

wraith sentinel
#

cant click on it

#

@reef stone

#

this is the line

serene girderBOT
#

studio** You are now Level 5! **studio

reef stone
# wraith sentinel cant click on it

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

barren marsh
#

like bro it tells u exactly where the error is

#

we cant read with your eyes

wraith sentinel
#

it saying this now

#

i do...

wraith sentinel
#

on the screenshot I took

barren marsh
#

are you sure this can be done on a local script

wraith sentinel
#

i have no idea

#

its for a button

#

so...

barren marsh
#

also why doesnt it just fire the server and the server determines that anyway

wraith sentinel
#

i think so

barren marsh
#

right now anyone can just fire that remote event and get a meme car for free

wraith sentinel
#

how do i fix it

#

who knows

barren marsh
#

have the server do the logic

wraith sentinel
#

after almost a year of looking at that passes documentation thing. I still dont know what to do... @reef stone

reef stone
wraith sentinel
#

what to do

#

i understand how those scripts work but idk how to change mine

reef stone
wraith sentinel
#

:/

#

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

reef stone
wraith sentinel
#

ye