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: Can't get a moving brick to stop

Previous Thread :: Next Thread 
GeneralN0torious is not online. GeneralN0torious
Joined: 19 Dec 2010
Total Posts: 2450
22 Jan 2013 11:07 AM
My friend is too scared of the community so he's making me post this for him.

p = script.Parent
while true do
repeat
wait(0.001)
p.CFrame = p.CFrame * CFrame.new(0,0.2,0)
until p.Position == Vector3.new(0,430,0)
end

He's not very good at scripting, so I know he's probably missing an easy way to do this. The brick won't stop once it reaches a certain position. Can anyone help?
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
22 Jan 2013 11:11 AM
p = script.Parent

while p.CFrame < CFrame.new(0,430,0) do
wait(0.001)
p.CFrame = p.CFrame * CFrame.new(0,0.2,0)
end

~A3~
Report Abuse
GeneralN0torious is not online. GeneralN0torious
Joined: 19 Dec 2010
Total Posts: 2450
22 Jan 2013 11:15 AM
That gave him this error

Workspace.LavaB.Script:3: attempt to compare two userdata values
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
22 Jan 2013 11:17 AM
o.o Stupid roblox updates. That normally works for me.

~A3~
Report Abuse
GeneralN0torious is not online. GeneralN0torious
Joined: 19 Dec 2010
Total Posts: 2450
22 Jan 2013 11:18 AM
It also doesn't even move with that script. It moves with the other one, just doesn't stop.
Report Abuse
awas3 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
22 Jan 2013 11:20 AM
p = script.Parent
while true do
wait(0.001)
if p.Position ~= Vector3.new(0,430,0) then
p.CFrame = p.CFrame * CFrame.new(0,0.2,0)
end
end


How about that?

~A3~
Report Abuse
GeneralN0torious is not online. GeneralN0torious
Joined: 19 Dec 2010
Total Posts: 2450
22 Jan 2013 11:23 AM
Still doesn't work, and he also says his Studio is trying to crash itself from lag.
Report Abuse
cj10127 is not online. cj10127
Joined: 26 Jul 2009
Total Posts: 1818
22 Jan 2013 11:29 AM
p = script.Parent
while p.Position.Y < 430 do
wait(1/30)
p.CFrame = p.CFrame * CFrame.new(0,0.2,0)
end
Report Abuse
GeneralN0torious is not online. GeneralN0torious
Joined: 19 Dec 2010
Total Posts: 2450
22 Jan 2013 11:35 AM
Thank you cj.
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