Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 28 May 2013 03:00 PM |
Why doesnt this work?
function touched(x) x.BrickColor = Color3.new(math.random(1,255),math.random(1,255),math.random(1,255)) local y = x.Parent:FindFirstChild("Humanoid") y.Health = 0 wait() x.Position = Vector3.new(math.random(1,20),math.random(1,20),math.random(1,20)) z = Instance.new("Message",Workspace) z.Text = "YOU HAVE TOUCHED MY BLOCK!" wait(5) z:Remove() end |
|
|
| Report Abuse |
|
|
| 28 May 2013 03:05 PM |
You didn't call it... Put this at the end:
object.Touched:connect(touched)
Change object to the block you want to edit
Soup's on, everybody! ~LuaLearners Writer~ |
|
|
| Report Abuse |
|
|
| 28 May 2013 03:06 PM |
Just for reference >
Connections don't call the function right away, they wait until the event is fired and then they call the function they are asigned to. |
|
|
| Report Abuse |
|