Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.