lucas301
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 1307 |
|
|
| 12 Mar 2013 12:47 PM |
function Player(input) --Calls the Player method and has a string in the parenthesis. if input ~= nil then --If the users chatted message doesn't equal nothing then script.Parent.Text = (input.Name + input) --Gets users name and input in GUI end end game.Players.LocalPlayer.Chatted:connect(Player) --Method created.
It's not working ;-;?!?!?!?! |
|
|
| Report Abuse |
|
|
lucas301
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 1307 |
|
|
| 12 Mar 2013 12:48 PM |
| Oh yeah, plus it doesn't show any error messages either. |
|
|
| Report Abuse |
|
|
lucas301
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 1307 |
|
|
| 12 Mar 2013 12:51 PM |
Argh, found a few mistakes, here's fixed but still not working:
player = game.Players.LocalPlayer function Player(input) if input ~= nil then script.Parent.Text = (player.Name + input) end end game.Players.LocalPlayer.Chatted:connect(Player)
|
|
|
| Report Abuse |
|
|
einsteinK
|
  |
| Joined: 22 May 2011 |
| Total Posts: 1015 |
|
|
| 12 Mar 2013 12:52 PM |
it's input..player.Name or player.Name..input (string1 .. string2) |
|
|
| Report Abuse |
|
|
lucas301
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 1307 |
|
|
| 12 Mar 2013 12:57 PM |
| Oh yeah! I've been learning Java lately, and now they're being intercepted with Lua >.< |
|
|
| Report Abuse |
|
|
lucas301
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 1307 |
|
| |
|
lucas301
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 1307 |
|
|
| 12 Mar 2013 01:00 PM |
Argh.. still not working :(? And it's showing no error either: (edited)
local localplayer = game.Players.LocalPlayer function Player(input) if input ~= nil then script.Parent.Text = (localplayer.Name .. input.Chatted) end end game.Players.LocalPlayer.Chatted:connect(Player)
|
|
|
| Report Abuse |
|
|
einsteinK
|
  |
| Joined: 22 May 2011 |
| Total Posts: 1015 |
|
|
| 12 Mar 2013 01:01 PM |
| input IS the chatted message, no Java events here |
|
|
| Report Abuse |
|
|
lucas301
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 1307 |
|
|
| 12 Mar 2013 01:04 PM |
| I meant that I'm learning Java, and I'm getting mixed up with Lua >.<.. |
|
|
| Report Abuse |
|
|
lucas301
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 1307 |
|
|
| 12 Mar 2013 01:05 PM |
| Like in print, Java uses + to put them all together, but in Lua it uses .. |
|
|
| Report Abuse |
|
|
lucas301
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 1307 |
|
| |
|
einsteinK
|
  |
| Joined: 22 May 2011 |
| Total Posts: 1015 |
|
|
| 12 Mar 2013 01:48 PM |
local player = game.Players.LocalPlayer
function Player(input) if input ~= nil then script.Parent.Text = player.Name .. input end end
player.Chatted:connect(Player) |
|
|
| Report Abuse |
|
|
lucas301
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 1307 |
|
|
| 12 Mar 2013 01:54 PM |
| Crap, I forgot to remove Chatted from my previous attempted script >.< thanks |
|
|
| Report Abuse |
|
|