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
4 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

1local ChatService = game:GetService("Chat")
2 
3local part = Instance.new("Part")
4part.Anchored = true
5part.Parent = workspace
6 
7ChatService:Chat(part, "Blame John!", "Red")
0
Add 'wait(2)' above line 7 CMVProduction 25 — 4y

1 answer

Log in to vote
0
Answered by
yx10055 57
4 years ago
01local ChatService = game:GetService("Chat")
02 
03local part = Instance.new("Part")
04part.Anchored = true
05part.Parent = workspace
06 
07game.Players.PlayerAdded:connect(function(player)
08    player.CharacterAdded:connect(function(character)
09        ChatService:Chat(part, "Blame John!", "Red")
10    end)
11end)

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