fire5000
|
  |
| Joined: 22 Sep 2009 |
| Total Posts: 303 |
|
|
| 25 Feb 2014 10:48 AM |
| So, I am pretty new to scripting. How do I make the brick that when it gets touched by a robloxian, a hint appears on the screen? |
|
|
| Report Abuse |
|
|
Ultraw
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 6575 |
|
|
| 25 Feb 2014 10:50 AM |
script.Parent.Touched:connect(function(hit) if hit.Parent ~= nil then h = Instance.new("Hint",workspace) h.Text = "TEXTHERE" end end)
|
|
|
| Report Abuse |
|
|
fire5000
|
  |
| Joined: 22 Sep 2009 |
| Total Posts: 303 |
|
|
| 25 Feb 2014 10:52 AM |
If I want it to destroy after a couple of seconds, is it this?
wait (3) message:destroy? |
|
|
| Report Abuse |
|
|
| |
|
DarkComa
|
  |
| Joined: 01 Apr 2011 |
| Total Posts: 11679 |
|
|
| 25 Feb 2014 10:55 AM |
Or I think you could use h:Remove()
Your number one grammar police Sheriff. |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2014 11:02 AM |
ur gonna need a debounce,otherwise the message will show up 1000s of times(LAG) ..heres an epic full script!:D
waiting = false
WaitTime = 5--can change
Brick = script.Parent
function onTouched(otherPart)
if otherPart.Parent:findFirstChild("Humanoid") and not waiting then --checks if its a human,and if its not currently "waiting"
waiting = true--sets the "waiting" to true (debounce)
h = Instance.new("Hint",Workspace)--creates the hint
h.Text = "whatever u want it to say here"--the text
wait(WaitTime)--waits however long you determined in "WaitTime"
waiting = false
--allows you to touch again
end--ends the if statement end--ends the function
Brick.Touched:connect(onTouched)--connection line |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2014 11:03 AM |
oh and after "waiting = false --allows you to touch again" add this: h:destroy()--remove is deprectiated |
|
|
| Report Abuse |
|
|
fire5000
|
  |
| Joined: 22 Sep 2009 |
| Total Posts: 303 |
|
| |
|
jd678
|
  |
| Joined: 18 Apr 2008 |
| Total Posts: 11529 |
|
|
| 25 Feb 2014 11:42 AM |
Don't question TheGamer101, use :Destroy()
Make a habit of using :Destroy() instead of :Remove(), for say you had a brick with a script inside of the brick running, :Remove() will remove the brick, :Destroy() will destroy the brick and all of it's contents, and the script inside of the brick would no longer be running. |
|
|
| Report Abuse |
|
|