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

Is it possible to make a part only visible to a player that owns a certain gamepass?

Asked by 7 years ago

Is it possible to make a part only visible to a play that owns a certain gamepass? If so, how can I achieve this? Does anyone have links to a ROBLOX wiki about this?

1 answer

Log in to vote
0
Answered by 7 years ago

There are two ways of doing this. If your game is FilteringEnabled you can just insert the part with a LocalScript and it will show up for that player only.

If it isn't FilteringEnabled you would simply check if the user has the gamepass and then put the part into workspace.CurrentCamera;

PlayerOwnsAsset Wiki

I hope this helped. If it did please accept this as the answer. If it didn't feel free to ask questions. (I didn't include any code because here on scripting helpers we do not just give out code. I am telling you methods on how to do it and letting you figure it out from there. Good luck!)

0
Do you know a way to do it for a certain rank in a group? OreoPatton 8 — 7y
0
Yep. Instead of doing PlayerOwnsAsset you would use the [:GetRoleInGroup()](http://wiki.roblox.com/index.php?title=API:Class/Player/GetRoleInGroup) function. It returns the role of the player (i.e., "Owner", "Guest", etc.) whatever their role may be. MrLonely1221 701 — 7y
Ad

Answer this question