Rep is not a valid member of Player

Rep is not a valid member of Player

image

image

THE SCRIPT:

local gamepass = 7016611
local mps = game:GetService(“MarketplaceService”)

game.Players.PlayerAdded:Connect(function(player)

-- TagText
	
-- TagTextColor	
	
local Color = nil
if player.Rep.Reputation.Value >= 0 then
		Color3.fromRGB(255, 255, 255)
	if player.Rep.Reputation.Value >= 1 then
			Color3.fromRGB(255, 85, 0)
	end	
		
-- TagTextColor	
		
local tags = {
        {
			TagText = "Innocent",
		TagColor = Color
		}
	}
    local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
    local speaker = nil
    while speaker == nil do
        speaker = ChatService:GetSpeaker(player.Name)
        if speaker ~= nil then break end
        wait(0.01)
    end
	speaker:SetExtraData('NameColor', Color)
	speaker:SetExtraData("Tags",tags)
    speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 255))
-- INNOCENT

-- LAWBREAKER

if mps:UserOwnsGamePassAsync(player.UserId,gamepass) == true or player.Name == "" then
	local tags = {
		{
			TagText = "🌟 VIP",
			TagColor = Color3.fromRGB(255, 255, 0)
		},
		{
			TagText = "Innocent",
			TagColor = Color3.fromRGB(255, 255, 255)
		}
	}
	local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
	local speaker = nil
	while speaker == nil do
		speaker = ChatService:GetSpeaker(player.Name)
		if speaker ~= nil then break end
		wait(0.01)
	end
	speaker:SetExtraData('NameColor', Color3.fromRGB(255, 255, 255))
	speaker:SetExtraData("Tags",tags)
	speaker:SetExtraData("ChatColor",Color3.fromRGB(255, 255, 0))
	end	
end	

end)

its a chat tag script that change if the player has enough value

Try using WaitForChild

if player:WaitForChild("Rep").Reputation.Value >= 0 then
1 Like