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

(Answered) Why am I receiving "lower is not a valid member of Player" from chat tags?

Asked by 3 years ago
Edited 3 years ago

I keep receiving "lower is not a valid member of Player 'Players.ChirpPerson'" from the following script located in ServerScriptService:

local ServerScriptService = game:GetService("ServerScriptService")
local ChatServiceRunner = ServerScriptService:WaitForChild("ChatServiceRunner")
local ChatService = require(ChatServiceRunner.ChatService)

local giveTag = game.ReplicatedStorage.GiveTag

giveTag.OnServerEvent:Connect(function(player)
    local speaker = ChatService:GetSpeaker(player)

    local DefaultTags = {
        {TagText = "FirstTag", TagColor = Color3.new(0,0,1)},
        {TagText = "SecondTag", TagColor = Color3.new(1,0,0)},
    }
    if speaker and speaker:GetPlayer() then
        speaker:SetExtraData("Tags", DefaultTags)
    end
end)

I don't know what could be wrong, any help is appreciated!

1
The parameter for GetSpeaker should be a string, do player.Name Spjureeedd 385 — 3y
0
@Spjureeedd THANK YOU SO MUCH IT WORKED! ChirpPerson 74 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

It was fixed courtesy of @Spjureeedd who suggested that the parameter for GetSpeaker should be a string by putting in "player.Name" instead of just "player." :)

Ad

Answer this question