|
| 20 Jun 2014 06:47 PM |
Trying to make a message come up when the key is pressed, won't work. could anyone fix it?
Mouse = game.Players.LocalPlayer:GetMouse() Mouse.KeyDown:connect(function(Key) Colors = {"Red"} if key:lower() == "z" then -- Change "z" to the key you want RandomColor = Enum.ChatColor[Colors[math.random(#Colors)]] chr = game.Players.LocalPlayer.Character chrh = chr.Head msg = "Hi" game:GetService("Chat"):Chat(chrh, msg, RandomColor) end end) |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 06:52 PM |
| I don't think the Chat service is able to call the Chat method. I think it's protected... |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 06:54 PM |
| I've seen it done in different games before, a certain key is pressed and a red chat bubble comes up displaying a message. It's not chatted, just pressed. |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 07:00 PM |
game:GetService("Chat"):Chat(chrh, msg, RandomColor)
Why go through the trouble of selection "Red" when you can just do "Red"? Unless, you want it to randomize between the three available colors (Blue,Green,Red)? |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 07:35 PM |
| i originally did, but then i just wanted red so i left it like that |
|
|
| Report Abuse |
|
|
| |
|
Sithex
|
  |
| Joined: 30 May 2010 |
| Total Posts: 1757 |
|
|
| 20 Jun 2014 10:46 PM |
like encoded said its probably protected the games you looked at probably have a custom built chat |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 11:01 PM |
repeat wait() until game.Players.LocalPlayer local plyr = game.Players.LocalPlayer local mouse = plyr:GetMouse()
mouse.KeyDown:connect(function(key) if key == "z" then game:GetService("Chat"):Chat(plyr.Character.Head,"Hi",2) end end) |
|
|
| Report Abuse |
|
|