I'm trying to make specific players have chat tags using Bool values in player stats (I.E V.I.P gamepass people, etc.) but it says everytime I try to edit the player's stats "Stats is not a valid member of Player", heres my code.
local F = Instance.new("Folder") F.Name = "Stats" local godking = Instance.new("BoolValue", F) godking.Name = "GodKing" game:GetService("Players").PlayerAdded:Connect(function(_plr) F.Parent = _plr if _plr.UserId == 88130316 then _plr.Stats.GodKing.Value = true end end)
Hello. Your Folder
should have the name: leaderstats
for it works.
Also, you should create a new Folder
and BoolValue
each time a player joins. So they'll have their own leaderstats. Here's an example: (Also, make sure it's a Script
.)
Here is the updated code:
local MarketplaceService = game:GetService("MarketplaceService") game.Players.PlayerAdded:Connect(function(player) local FolderStats = Instance.new("Folder", player) local VIPStatus = Instance.new("BoolValue", FolderStats) FolderStats.Name = "FolderStats" VIPStatus.Name = "VIPStatus" if MarketplaceService:UserOwnsGamePassAsync(player.UserId, PutHereTheGamepassID) then VIPStatus.Value = true end end)