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: Sand

Previous Thread :: Next Thread 
Zikefire is not online. Zikefire
Joined: 21 Mar 2009
Total Posts: 328
28 Oct 2011 08:08 PM
I am trying to make a simple script that will make the block "sand" move down through the floor when touched then come back up. One problem. It doesn't work!


script.Parent.Touched:connect(function(part)

sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0))
wait(1)
end)

This is was it says in the output: Disconnected event because of exception
Report Abuse
dslink2009 is not online. dslink2009
Joined: 05 Jul 2010
Total Posts: 1108
28 Oct 2011 08:39 PM
script.Parent.Touched:connect(function(part)
sand = part
sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position - Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0))
wait(1)
sand.CFrame = CFrame.new(sand.Position + Vector3.new(0,0.5,0))
wait(1)
end)

You never declared what sand was. Anyways, Y U NO USE FOR LOOP?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
28 Oct 2011 10:03 PM
=-=


For loop makes this easier..
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