Hello! I want to, make a system like If you buy Roblox premium, you get Adonis admin commands Ingame… The Issue Is, that I don’t know how to do It.
I have tried, making It like I make a normal game pass like you get VIP Door access Ingame, If you buy VIP from the game store.
This may be of use:
Player.MembershipType checks what type of membership the player has.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
if player.MembershipType == Enum.MembershipType.Premium then
-- Take some action specifically for Premium members
end
Hope this helps, Sylvern.
Thanks, Mr.Sylvem! can you, also teach me, how to grant the members of premium features… But the thing Is, I want people that buy premium, from my game gets the feature, not other people with premium.
Datastores are definitely not required. If I understood correctly, you need to give the player the benefits after he purchases Premium from the prompt in-Game and reward the benefits if they are already Premium.
I will briefly tell you the process you need to follow :
-
First, you need to prompt the Premium Purchase from the client as people told you above. Using : MarketplaceService | Documentation - Roblox Creator Hub
-
Secondly, you need to reward the player if he purchases premium in-game by using the PromptPremiumPurchaseFinished Event Using : MarketplaceService | Documentation - Roblox Creator Hub (Check Code Sample for example)
-
Finally, you need to check whether returning players are premium or not and you can do that by checking their Membership type as @Dev_Sylvern already told you above using : Player | Documentation - Roblox Creator Hub
That should be all you need however if you need help just reply back
Hey there! I haven’t tested this code but it might work. Sorry for weird formatting aswell.
-- this code copy pasted from Dev_Sylvern
local Players = game:GetService("Players")
local player = Players.LocalPlayer
if player.MembershipType == Enum.MembershipType.Premium then
local data = {
Settings = {
Admins = {player.Name}
};
}
require(359948692)(data) -- adonis API module
end
Where to put, the script ???..
I guess anywhere you want to put the script, server script service, workspace, in another script
One more question, can I change admin level? to mod.
Also It Is local script or just script?
it is a server script
(30 charsssssssssss)
Server script, and yeah just change the “Admins” to “Mods”
-- this code copy pasted from Dev_Sylvern
local Players = game:GetService("Players")
local player = Players.LocalPlayer
if player.MembershipType == Enum.MembershipType.Premium then
local data = {
Settings = {
Moderators = {player.Name}
};
}
require(359948692)(data) -- adonis API module
end
Thanks and, I mean the type local script or script…
That’s what I said, server script = normal script
Ok, tysm I will try It out, you legit helped me so much!!
So If a player, buys premium from my game gets mod?
Anyone who owns roblox premium will get mod.
Uhhh… I don’t wanted It like that, I want It to be like If a player buys premium, In my game gets mod…
Not entirely sure if you’re able to check if the player buys it from your game, but there is gamepasses you can use.
I got Idea, I can make sword, only premium can buy?.. like prompt It for only, Roblox premium players? And the sword, will give people mod.