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

Why does my script not chat with the object?

Asked by
MattVSNNL 620 Moderation Voter
3 years ago

So I'm trying to make an object chat and I used the chat service but It doesn't seem to be working, Can anyone help?

here's the code

local ChatService = game:GetService("Chat")

local part = Instance.new("Part")
part.Anchored = true
part.Parent = workspace

ChatService:Chat(part, "Blame John!", "Red") 
0
Add 'wait(2)' above line 7 CMVProduction 25 — 3y

1 answer

Log in to vote
0
Answered by
yx10055 57
3 years ago
local ChatService = game:GetService("Chat")

local part = Instance.new("Part")
part.Anchored = true
part.Parent = workspace

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        ChatService:Chat(part, "Blame John!", "Red") 
    end)
end)

It is chatting, but it's too fast. It chats immediately before the game loads. The script above will wait until your character loads into the game, then it chats.

Ad

Answer this question