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 4 years ago
Edited 4 years ago

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

01local ServerScriptService = game:GetService("ServerScriptService")
02local ChatServiceRunner = ServerScriptService:WaitForChild("ChatServiceRunner")
03local ChatService = require(ChatServiceRunner.ChatService)
04 
05local giveTag = game.ReplicatedStorage.GiveTag
06 
07giveTag.OnServerEvent:Connect(function(player)
08    local speaker = ChatService:GetSpeaker(player)
09 
10    local DefaultTags = {
11        {TagText = "FirstTag", TagColor = Color3.new(0,0,1)},
12        {TagText = "SecondTag", TagColor = Color3.new(1,0,0)},
13    }
14    if speaker and speaker:GetPlayer() then
15        speaker:SetExtraData("Tags", DefaultTags)
16    end
17end)

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 — 4y
0
@Spjureeedd THANK YOU SO MUCH IT WORKED! ChirpPerson 74 — 4y

1 answer

Log in to vote
0
Answered by 4 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