generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: how would i...

Previous Thread :: Next Thread 
1234andrewh is not online. 1234andrewh
Joined: 21 Apr 2012
Total Posts: 459
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
18 Jun 2013 02:09 PM
[ Content Deleted ]
Report Abuse
NVI is not online. 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
1234andrewh is not online. 1234andrewh
Joined: 21 Apr 2012
Total Posts: 459
18 Jun 2013 02:29 PM
i need help not jokes and i do know how to script
Report Abuse
NVI is not online. 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
1234andrewh is not online. 1234andrewh
Joined: 21 Apr 2012
Total Posts: 459
18 Jun 2013 02:31 PM
I have never done somthing where it is editing the playergui from workspace
Report Abuse
1234andrewh is not online. 1234andrewh
Joined: 21 Apr 2012
Total Posts: 459
18 Jun 2013 02:32 PM
you had a time that you didn't know scripting very well ether
Report Abuse
NVI is not online. 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
1234andrewh is not online. 1234andrewh
Joined: 21 Apr 2012
Total Posts: 459
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 is not online. 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
1234andrewh is not online. 1234andrewh
Joined: 21 Apr 2012
Total Posts: 459
18 Jun 2013 03:18 PM
already tryed that and i gave errors but nvm because i figered out a method
Report Abuse
grimm343 is not online. 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
1234andrewh is not online. 1234andrewh
Joined: 21 Apr 2012
Total Posts: 459
19 Jun 2013 09:40 PM
nvm i figered out a way
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image