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

My chat prefix is not working and the error seems questionable, how do I fix?

Here I have a Script in ServerScriptService.

local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"))
local Marketplace = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local Player = Players:WaitForChild(Players.LocalPlayer)
local Chat = game:GetService("Chat")
local PassID = 10492005

Players.LocalPlayer.Chatted:Connect(function(speaker)
	if Marketplace.PlayerHasPass(Players.LocalPlayer,PassID) then
		speaker:SetExtraData("Tags", {{TagText = "VIP", TagColor = Color3.new(255,255,0)}})
	end
end)

The errors I get are:

Attempted to call require with invalid argument(s). and require(assetId) cannot be called from a client.

It's a normal script, and it's not on the client? How do I fix it?

1 answer

I know this is quite a short answer but try this.

local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"))
local Marketplace = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local Player = Players:WaitForChild(Players.LocalPlayer)
local Chat = game:GetService("Chat")
local PassID = 10492005

Players.LocalPlayer.Chatted:Connect(function(speaker)
    if Marketplace.PlayerHasPass(speaker,PassID) then
        speaker:SetExtraData("Tags", {{TagText = "VIP", TagColor = Color3.new(255,255,0)}})
    end
end)

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