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

[SOLVED] I am trying to add tags into chat. What am I doing wrong?

Asked by 4 years ago
Edited 4 years ago
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
print(ChatService) -- No print

local owners = {QuikSilver09 = true, flameman0987 = true}
local devs = {ThetaBird = true, dogbrainxd = true}
print("2 tbls") -- Prints fine

local ownerTag = {TagText = "OWNER", TagColor = Color3.fromRGB(42, 145, 255)}
local VIPTag = {TagText = "VIP", TagColor = Color3.fromRGB(255, 206, 7)}
local FANTag = {TagText = "Fan", TagColor = Color3.fromRGB(43, 255, 43)}
print("5 tbls") -- Prints fine

game:GetService("Players").PlayerAdded:Connect(function(player)
    print("player JOINED") -- No print

    if owners[player.Name] then
        print("line")
        local speaker = ChatService:GetSpeaker(player.Name)
        speaker:SetExtraData("Tags", ownerTag)
    elseif player:WaitForChild("Gamepasses"):WaitForChild("VIP").Value then
        local speaker = ChatService:GetSpeaker(player.Name)
        speaker:SetExtraData("Tags", VIPTag)
    elseif player:IsInGroup(4515569) then
        local speaker = ChatService:GetSpeaker(player.Name)
        speaker:SetExtraData("Tags", FANTag)
    end
end)

I believe the issue is this line local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))

I have commented it out and my PlayerAdded function runs just fine. I just do not know what to do considering I am getting no errors. Any help would be great, thanks.

0
i think you havent ended the require yet, has no ) in it ceyhunveysel 28 — 4y
0
I did it just got cut. Player was loading before chat service that was the issue QuikSilver09 5 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

i think you havent ended the require yet, has no ) in it

Ad

Answer this question