Error When Trying To Detect Premium

Hello developers,

I’ve been having a problem with detecting if a player’s membership is premium. I followed what the Developer Hub showed and it doesn’t work (I copied and pasted it, made a few changes and it still didn’t work). I even found some topics on here (the forum), but those all had the Developer Hub thing as their solution.

I keep getting this error in the output:
Screenshot (198)

(BTW, this is my code if you’re wondering what it looks like:
Screenshot (200)
)

Is this in a server script or a local script?

1 Like

It’s in a server script in serverscriptservice

That’s why. In order to use localplayer, it needs to be in a local script, although player membership might not work there.

2 Likes

Put this in remote events? Sorry if this is wrong, I have some experience with scripting but not a lot. I’m a builder.

1 Like