|
| 08 Jul 2013 04:46 PM |
| I know how to make it, but when someone touches a brick, it shows a message with their name on it. How do I make it so it shows their name on it? |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2013 04:46 PM |
| By using the Part.Touched event. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2013 04:47 PM |
| you clearly didn't read my full post. |
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 08 Jul 2013 04:48 PM |
First it's a capatilized O and T OnTouched and it's a function what did you write in it?
I might be able to help |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2013 04:49 PM |
| With the Part.Touched event. And Humanoids. Probably want some waits thrown in there, too. I will not, however, make the script for you. That's for you to do. I will simply tell you what you need, and help if you need it |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2013 04:50 PM |
| @thetacah: Function names are meaningless, so long as they are not keywords. |
|
|
| Report Abuse |
|
|
| |
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 08 Jul 2013 04:51 PM |
@thetacah It doesn't matter what the function is named. However the event is .Touched
function blueberrywafflesontoast(fingerlickngewd) print(fingerlickngewd.Name) end script.Parent.Touched:connect(blueberrywafflesontoast) |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2013 04:51 PM |
| I clearly said, I know how to do an onTouched function. I don't need help on that part. But how do I make it so the script knows which player touched it and what their username is. Try reading. It helps. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2013 04:54 PM |
Players:GetPlayerFromCharacter(Instance Character)
Try reading the wiki. It helps. |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 08 Jul 2013 04:55 PM |
The .Touched event gives the function the BasePart that was used to touch it.
script.Parent.Touched:connect(function(hit) print(hit.Name) end)
Now, for what you would like, assuming that a Hat wouldn't trigger the Message to show.. local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr then --create a new Message, Parent it to wherever you would like it.. The plr.StarterGui would only let that Player see it, Workspace would let everybody see it. --Set the Message's Text to plr.Name end |
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 08 Jul 2013 04:56 PM |
| Guys I know I ment the event sorry |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 08 Jul 2013 04:56 PM |
concatenation of the hit argument
local db = true script.Parent.Touched:connect(function(hit) --hit is whatever touched the brick if hit and db and hit.Parent:findFirstChild("Humanoid") then db = false m = Instance.new("Message", game.Players:GetPlayerFromCharacter(hit.Parent).PlayerGui) m.Text = "Hello, "..hit.Parent.Name.. "!" --hit would probably print right or left leg. Hit.Parent will get the player's name. game:GetService("Debris"):AddItem(m, 3) wait() db = true end end)
prolly l8 w/e |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
| |
|
|
| 09 Jul 2013 08:10 PM |
Please note that everyone will see this message.
working = false script.Parent.Touched:connect(function(hit) if working == false then working = true m = Instance.new("Message", Workspace) m.Text = hit.Parent.Name wait(5) --How long you want to wait m:Destroy() working = false end end)
If you want only the user who touched the brick to see the message, that would require a custom created model to be put into lighting and cloned into the Player's PlayerGui, so I can't really help you there XD
*Tell me about the rabbits, George* |
|
|
| Report Abuse |
|
|