ROBLOX Premium Detector / Rewards

So working with the new ROBLOX Premium System, I am attempted to make a “Pet Script” to reward ROBLOX Premium Members a pet in game, currently when I released the update of the game, the script did not work.

SCRIPT:
local Players = game:GetService(“Players”)
local player = Players.LocalPlayer

game.Player.PlayerAdded:Connect(function(player)
if player.MembershipType == Enum.MembershipType.Premium then
player[“Pets”][“75”].Value = true
else
if not player.MembershipType == Enum.MembershipType.Premium then
player[“Pets”][“75”].Value = false
end
end
end)

Any Suggestions or Ideas on how to get this to work?

If thats a ServerScript, LocalPlayer doesnt work in ServerScripts so just use the playeradded argument.

If thats a local script, PlayerAdded doesnt work in LocalScripts

You seem to be defining “player” twice, remove line 2. You have also done game.Player when it should be Players. Hope this helps. This script should also be a server

Edit: The “if not” part after else is not needed as it would run for people without premium.

Edit2: We decided on Discord to use a local script and follow this API to check if the player has premium and then Fire a remote event to give the player benefits through a server script after receiving the ServerEvent.

1 Like

Ive just edited my original post, hope it helps :slight_smile:

Ill try it thank you. Ill let u know if it works!

1 Like