Hello. I am hug125215 and I am trying to give to users that own the Roblox premium users a tool called LoungeAccess.
But, when I test the game, I don’t find any error in the F9 logs related to the script but the tool is not given to me, even if I own the Roblox premium subscription.
I used this code which is available on the developer hub, here: Premium Payouts and added more code to give a tool to the player,but it is not working.
More details and information in the pictures below:
Location of the localscript:
Have a good day and I hope that you will be able to help me!
First of all, you cannot access the ServerStorage or any of the server-sided containers with a LocalScript. This has to be done with a server-sided Script.
Second, you cannot add something to the player backpack before the player’s character has spawned or “loaded” into the game.
Here’s an example of how you would approach this assuming the script is in ServerScriptService:
if Player.MembershipType == Enum.MembershipType.Premium then
game.ServerStorage.LoungeAccess:Clone().Parent = Player.Backpack
You cant use a LocalScript for this type of thing instead you could use a simple script that is in SSS, and you just check if the player has premium.
local SS = game.ServerStorage
if player.MembershipType == Enum.MembershipType.Premium then
SS.TOOL:Clone().Parent = player.Backpack
SS.TOOL:Clone().Parent = player.StarterGear
TOOL being the tool/gear you wish to give the premium user who has joined the game.