The current thread cannot call 'Chat' (lacking capability Plugin)

hello! im trying to get more familiar w module scripts but it keeps throwing me this error. ty

module:

local distancekillModule = {}

function distancekillModule.playerAdded(plr:Player)
local plrs:Players = game:GetService("Players")
plrs:Chat("heello!")
end

game.Players.PlayerAdded:Connect(distancekillModule.playerAdded)

return distancekillModule

script:

local module = require(script.distancekillModule)

module.playerAdded()

Your script is fine, its just that Players:Chat() doesn’t work because, Players is the storage of all the player instances and calling Chat doesn’t make sense, since your basically telling the player storage to chat?

1 Like

that function is corescript only (idk why plugins can call it)
use TCS SendMessage or the remote events if not TCS

sorry im not sure what u mean by TCS. wdym? ty 4 ur response btw!

hello! ty 4 ur reply. yes thats very valuable information. what im trying to do is when a player joins, i want them to say something if that makes sense. i tried Chat:chat(Character.Head, "hello") something like that but i cant get it to work tbh

TextChatService,
there should be some channel things under, you should study the documentation though

1 Like

ah yes ty!

i tried putting in the displaybubble feature but its not displaying tbh. thought i had to put a wait but nope.

function distancekillModule.playerAdded3()
	game.Players.PlayerAdded:Connect(function(plr)
		plr.CharacterAppearanceLoaded:Connect(function(char)
			wait(2)
			if plr.UserId == 64032380 or plr.Name == "targetframed" then
				print("check complete, "..plr.Name.. " has joined the server")
				local tcs:TextChatService = game:GetService("TextChatService")
				tcs:DisplayBubble(char.Head, "hello lol")
			end
		end)
	end)
end

The code needs to run on the client for displaybubble to work

1 Like

tysm got it have a great day :smiley:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.