Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

What do I do with "Argument 2 missing or nil"?

Asked by 3 years ago
local gamepassId = 14162627
local service = game:GetService("MarketplaceService")
game.Players.PlayerAdded:Connect(function(player)
    if (service:UserOwnsGamePassAsync(player,UserId, gamepassId)) then
        local tags = {TagText = "[Donator]"}
        local tags = {TagColor = Color3.fromHSV(Random)}

        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("Tags",tags)
        speaker:SetExtraData("ChatColor",Color3.fromHSV(Random))
    end
end)

I am using this script to give to someone who has the game pass, they will get a chat title but "Argument 2 missing or nil: at line 4. I have been searching on a lot of forums but I can't find a solution. CAn anybody here help me?

1 answer

Log in to vote
0
Answered by 3 years ago

You accidentally used a comma instead of a full stop at line 4.

Ad

Answer this question