I need help, I've been looking for hours on how to fix this, I've also asked a tried to ask a few people with no success, the script I've made is for chat tags, but they don't work at all, the error is in the question title, I am very tired when I write this so don't mind my terrible English and whatnot here is the script. https://pastebin.com/BYid0YrX
Thanks in advance, Destroyer1234x.
I think this is because of the delay between the moment the player joins and until ROBLOX makes them a Speaker
.
Instead try binding your function to SpeakerAdded
in ChatService
this way whenever your function runs, the speaker will always be there
One tip for you though is to use assert()
, it's a good debugging tool and really easy to use. Basically if the condition is false
it prints what you told it to and breaks, so like this:
assert(true,"This will never print because the condition is always true") assert(false,"This will always print because the condition is always false") print("This will not print because when assert if false, it breaks")
plr = game.Players:FindFirstChild("someReallyWeirdName") assert(plr,"If this prints then the player doesn't exist and if the code runs it will error")