#topbar+ gamepass needed to use

1 messages · Page 1 of 1 (latest)

craggy cloak
#

What have you done so far

dim quarry
#

check if a player has a gamepass b4 executing the button script

#

ez

thin orbit
#

i lowk dont know what to do

#

im assuming something like require:gamepass(2391239123) or soemthing but ionknow topbar

dim quarry
#

:UserOwnsGamepassAsync(Player.UserId, GamepassId)

brittle swallowBOT
#

studio** You are now Level 2! **studio

thin orbit
#

why are these two underlined

dim quarry
#

game:GetService("MarketplaceService")

thin orbit
#

player is still underlinewd

mighty tree
thin orbit
#

what do i define it as

#

local player = game.player

mighty tree
#

is this a local script

#

@thin orbit ?

thin orbit
#

yes

#

for topbar+

#

local localPlayer = game:GetService("Players").LocalPlayer

#

does this work

mighty tree
#

then

local player = game.Players.LocalPlayer
thin orbit
#

ok

mighty tree
#

with local

thin orbit
#

oh wait

mighty tree
#

btw you're supposed to say it like this:

game:GetService("MarketplaceService"):UserOwnsGamepassAsync(Player.UserId, GamepassId)
thin orbit
#

one big line

mighty tree
#

meh

thin orbit
#

lemme try

#

so this should let me use the topbar button if i own the gamepass?

mighty tree
thin orbit
#

ok lemme try it

#

it doesnt workingson

mighty tree
#

okay maybe tell us what you're tryna do and what's happening so I get the full picture

thin orbit
#

okay let me break it down for you

dim quarry
thin orbit
#

so i have a character selection

#

and i want you to need a gamepass for some characters

#

and the topbar is my character selectino rn

#

and i want some of the topbar buttons to only work with gamepass

mighty tree
# thin orbit

I am more concerned about how the hell did this happen

thin orbit
#

yeah idk i checked output

mighty tree
#

maybe it's not loading in time? so maybe if you split it like this it'll work

local marketPlaceService = game:GetService("MarketplaceService")
marketPlaceService:UserOwnsGamePassAsync(Player.UserId, GAMEPASS_ID)
#

BRO

#

YOU MADE A TYPO

#

you said :UserOwnsGamepassAsync(Player.UserId, GamepassId)

instead of

:UserOwnsGamePassAsync(Player.UserId, GamepassId)

mighty tree
thin orbit
#

ok i tried what you did

#

lemme sohw u soemthing

#

it still fires the event

#

either way if i own it or not

mighty tree
#

btw why are you using ContextActionService for this? why not just check if the guy clicked on a button

thin orbit
#

im not idk how to do that im jsut using topbar+

#

idk how to use both of those together so this is jsut easier for me

olive kindle
thin orbit
#

that what i thought

#

but ineed this button in my thing to only fire event if someone owns a gamepass pyro

olive kindle
# thin orbit that what i thought

i'd be more helpful but you've probably never read a docs page in your life and this has basically devolved into code begging and do-it-for-you which i don't want to be part of

mighty tree
olive kindle
#

also it's a monetization feature and those come at a premium

#

i'm mostly just watching how ob3e do.

#

;p

thin orbit
#

😭

brittle swallowBOT
#

studio** You are now Level 3! **studio

mighty tree
#

I am gonna be honest I've never seen :bindEvent used outside of cas

thin orbit
#

its like like like

#

i just tryna figure out this one thing here

#

ive never asked for any help on this before

mighty tree
#

I am not familiar with using events the way you do so I don't think I can really help

thin orbit
#

ok

#

maybe somone else could help me

mighty tree
#

yeah like @olive kindle

thin orbit
#

yeah like pyro-fire

#

im not a code begger i just have problem with topbar idk how to use it

#

fully

olive kindle
thin orbit
#

bro all it is is topbar+

olive kindle
mighty tree
#

bro dipped 💀

olive kindle
mighty tree
olive kindle
#

they took the function call that checks, and failed to turn it into a condition. nothing to do with topbar+ at that point lol

olive kindle
mighty tree
#

so bro doesn't know how to use a module that does everything for him crazy

olive kindle
#

it has a few fancies to give it icons and position and styles and such, but textbutton.Activated is the same as bindEvent("selected",...)

olive kindle
mighty tree
#

so he had to check if the button was clicked right

olive kindle
#

that's the bindevent

#

only needs to check the gamepass, using the function you gave

#

and put it in an if statement

#

like, that's it

#

lol

mighty tree
#

so basically if the userOwnsGamePass thing returned true

olive kindle
#

then fire event, yeah.

mighty tree
#

imagine bro looking back at this and jumping off his chair

olive kindle
mighty tree
#

another classic case of can't expect results if you don't put in the work

#

anyway we should probably leave this thread alone now

olive kindle
#

yeaa it's not the most productive thing, not always the most helpful, which is why i didn't want to say anything because i'm not going to be of help, but it does pain me to see people getting run through the ringer of "i just need help with this ONE thing!" and then waste hours on an if statement and spoonfeeding them code.

#

over a monetization feature no less - like cmon you setting up payments without offering any of that pay in exchange? that just doesn't sit right with me 🤷

#

also really, if you're getting stuck on an if statement, always makes me curious how they manage to get these games that could justify adding monetization in the first place

mighty tree
#

basically just making a game without knowing shit about how to make games

olive kindle
mighty tree
#

I ran into a similar thing today was telling the guy you need to use a for loop and then he said "what's that"

olive kindle
#

they got their hands on a leaked clone, or maybe bought it for $5, and now they want to add gamepass and compete with tsb when they can't handle an if statement

#

it really is an enigma

olive kindle
#

as a technique for actual development, idk man, some people get by on that. heck, that's probably how deadrails was made

#

well, to start with

mighty tree
olive kindle
mighty tree
olive kindle
#

give very basic instruction, still no clue, so you simply do it for them

#

seen that time and time again and every time it makes baby jesus cry 😢

mighty tree
#

I mean they probably didn't know how to get better the right way so they cheaped out

olive kindle
#

i seen all 3 many times

mighty tree
olive kindle
mighty tree
olive kindle
#

nevermind the hours, days, weeks you can spend tracking down exactly which line to change and what to change it to, "it's only one line!"

olive kindle
# mighty tree the two lines are probably 80 characters each lol

na, the worst i've seen is 2 closures one with a missing end, and another with an extra end. literally only one line needed to move. that took me like 2 weeks to fix coz the code somehow worked just fine except for some niche buggy behavior that didn't happen often, or happened randomly

mighty tree
olive kindle
#

point is around 70~80% of code work is reading code and docs and planning things out, not writing new lines or changing existing lines.

#

"it's only one line!"

mighty tree
olive kindle
#

yeah that takes a while too

mighty tree
#

I always document the bugs I run across

#

so that doesn't happen

#

on a trello board

olive kindle
#

i just use a todo list ;p

#

only works for solo dev tho

mighty tree
#

trello is fancier and has more functionality

#

but you do you

olive kindle
#

i suppose can't be too harsh though, gotta keep in mind fair number of people are gamers who are looking into game dev, and roblox makes it look super easy, barely an inconvenience

#

in reality it's very hard

mighty tree
#

yup

thin orbit