|
| 18 Jun 2013 01:58 PM |
| make it so that if you hit a part it will change the text of a gui on your screen? |
|
|
| Report Abuse |
|
|
NVI
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 4744 |
|
|
| 18 Jun 2013 02:01 PM |
You learn to script, that's how. :P I'll give you a hint: it involves connecting to a Touched event on the part, and it involves manipulating a GUI object's Text property.
I don't know how you're setting this up, but here's something generic:
part.Touched:connect(function(p) local player = game.Players:GetPlayerFromCharacter(p.Parent) -- not sure if this ACTUALLY works, to be honest if player ~= nil then --change this next line player.PlayerGui.ScreenGui.TextLabel.Text = "potato" end end) |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 18 Jun 2013 02:02 PM |
@NVI It does. :P As for the 'if' statement, you could also simply use 'if player then' |
|
|
| Report Abuse |
|
|
NVI
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 4744 |
|
|
| 18 Jun 2013 02:03 PM |
| I prefer to be verbose. You'll learn to do that if you ever work on a large project with team members. |
|
|
| Report Abuse |
|
|
abaw7
|
  |
| Joined: 23 Oct 2009 |
| Total Posts: 745 |
|
|
| 18 Jun 2013 02:03 PM |
| @NVI It does work, I use it constantly now. It saves time not having to make a loop to check it |
|
|
| Report Abuse |
|
|
abaw7
|
  |
| Joined: 23 Oct 2009 |
| Total Posts: 745 |
|
|
| 18 Jun 2013 02:04 PM |
| Oops, when I started posting that, it was just your message |
|
|
| Report Abuse |
|
|
NVI
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 4744 |
|
|
| 18 Jun 2013 02:04 PM |
| I remember trying to use it back in 2007 and getting absolutely no luck. It seemed to halt script execution if it wasn't a player's character. I don't remember though. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
NVI
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 4744 |
|
|
| 18 Jun 2013 02:10 PM |
| Man, now I want to code an engine in C++ with Lua. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2013 02:29 PM |
| i need help not jokes and i do know how to script |
|
|
| Report Abuse |
|
|
NVI
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 4744 |
|
|
| 18 Jun 2013 02:30 PM |
| Well clearly not very well, or you wouldn't be asking this question. It's quite a simple script. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2013 02:31 PM |
| I have never done somthing where it is editing the playergui from workspace |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2013 02:32 PM |
| you had a time that you didn't know scripting very well ether |
|
|
| Report Abuse |
|
|
NVI
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 4744 |
|
|
| 18 Jun 2013 02:32 PM |
| No I didn't. I was born with a keyboard in my hands. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2013 02:34 PM |
| i asked for help can you please help me or am i going to have to give up? |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 18 Jun 2013 02:43 PM |
You asked for help, yes. You were given a more-than-helpful answer, long ago. Use NVI's script. Define part and change the path to the TextLabel or the string that the Text property is set to, so it works exactly how you want it. He gave you more help than you would've gotten from anybody else.
part.Touched:connect(function(p) local player = game.Players:GetPlayerFromCharacter(p.Parent) if player ~= nil then player.PlayerGui.ScreenGui.TextLabel.Text = "potato" end end) |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2013 03:18 PM |
| already tryed that and i gave errors but nvm because i figered out a method |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 18 Jun 2013 03:37 PM |
| It gave errors because you didn't define 'part', and you probably didn't double-check the path to the TextLabel. |
|
|
| Report Abuse |
|
|
| |
|