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: Simple Script Wont Work?

Previous Thread :: Next Thread 
Hibobb is not online. 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
cheesecake123456 is not online. cheesecake123456
Joined: 01 Jun 2009
Total Posts: 1529
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
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
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
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