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: Water script... keeps running dry....

Previous Thread :: Next Thread 
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
14 Mar 2013 08:25 PM
I have an ocean in my game, and in this ocean, there is a script to make the water appear to move.... however, after a few minutes, the ocean runs completely dry, all the water goes under the ground below it.... Then it floods.... I dont really know what the problem is, but I assumed that the mesh was moving to the -Y, the returning. My assumption also concluded that it expanded to -Y, then contracted from +Y on the return... Anyways, take a look, i want to fix it...

mesh = script.Parent.Mesh

while true do
for i=25, 4, .0005 do
mesh.Scale = Vector3.new(i,i,i)
wait()
end
wait()
for i=30, 2.4, -.0005 do
mesh.Scale = Vector3.new(i,i,i)
wait()
end
wait()
end
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
14 Mar 2013 08:27 PM
Logic-wise, I'm not sure, but the step in the first for loop should be negative.

¤ ¤ † K M <( •д• )> X D † ¤ ¤
Report Abuse
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
14 Mar 2013 09:23 PM
oh i see, nvm... if you have your Y values different at the start, you get some movement... it should be like this....

mesh = script.Parent.Mesh

while true do
for i=25, 1, .0005 do
mesh.Scale = Vector3.new(i,i,i)
wait()
end
wait()
for i=30, 1, -.0005 do
mesh.Scale = Vector3.new(i,i,i)
wait()
end
wait()
end


Simplified, it means:

Look for mesh in the Parent of script

while true do:
make mesh grow in X and Z values by .0005
heres the guide lines for changing the properties of mesh
wait a little
stop process.
wait a little
when mesh gets to scale 30, shrink X and Z values by -.0005
heres the guide lines for changing the properties of mesh
wait a bit
stop process
wait a bit
return to "while true do"
Report Abuse
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
14 Mar 2013 09:30 PM
yeah, no, still drops... and im trying to get it to have a bit of up and down motion (+y wait{some amount of time} -Y)
Report Abuse
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
14 Mar 2013 09:35 PM
well, i think i have seen the issue... what the script did is it made the mesh 29 x 29 x 29, then kept adding .0005 until it got to 30, then shrank.... any suggestions on how to fix that?
Report Abuse
6dawg34 is not online. 6dawg34
Joined: 31 Aug 2011
Total Posts: 305
14 Mar 2013 09:43 PM
while true do
a = math.random(20,30)
b = math.random(4,15)
for i = 25, a,-.0005 do
mesh.Scale = Vector3.new(mesh.Size.X,i,mesh.Size.Z)
wait(.1)
end
wait()
for d = a,b, -.0005 do
mesh.Scale = Vector3.new(mesh.Size.X,d,mesh.Size.Z)
wait(.1)
end
wait()
end

This should work. added some cool new things to btw.
Report Abuse
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
14 Mar 2013 09:44 PM
thx, ill get all over testing this pronto
Report Abuse
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
14 Mar 2013 09:47 PM
haha, i forgot to mention its a SpecialMesh, anyways, ill fix the errors, they should be easy
Report Abuse
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
14 Mar 2013 09:48 PM
hmm, this one is puzzling though...

22:46:09.759 - Size is not a valid member of SpecialMesh
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
14 Mar 2013 09:52 PM
Scale, not size.
Report Abuse
6dawg34 is not online. 6dawg34
Joined: 31 Aug 2011
Total Posts: 305
14 Mar 2013 09:54 PM
Ya here I fixed it.

a = math.random(20,30)
while true do
b = math.random(4,29)
for i = a, b,-.05 do
script.Parent.Scale = Vector3.new(script.Parent.Scale.X,i,script.Parent.Scale.Z)
wait()
end
wait()
for d = b,a,.05 do
script.Parent.Scale = Vector3.new(script.Parent.Scale.X,d,script.Parent.Scale.Z)
wait()
end
wait()
end
Report Abuse
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
14 Mar 2013 10:04 PM
hmmm Scale is not a valid member of Part.... you never said Mesh, and this is what it looks like at the moment, posting errors...

mesh = script.Parent.Mesh
a = math.random(20,30)
while true do
b = math.random(4,29)
for i = a, b,-.05 do
script.Parent.Scale = Vector3.new(script.Parent.Scale.X,i,script.Parent.Scale.Z)
wait()
end
wait()
for d = b,a,.05 do
script.Parent.Scale = Vector3.new(script.Parent.Scale.X,d,script.Parent.Scale.Z)
wait()
end
wait()
end
Report Abuse
6dawg34 is not online. 6dawg34
Joined: 31 Aug 2011
Total Posts: 305
14 Mar 2013 10:06 PM
Put it in the mesh.
Report Abuse
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
15 Mar 2013 06:51 AM
lol, it only goes up and down, and it looks like someone pulled the plug,, then rapidly filled it back in.... Im glad it does the up and down, kinda like the tide rolling in, but thats all there is to it.
Report Abuse
Joseph96gr is not online. Joseph96gr
Joined: 28 Aug 2012
Total Posts: 383
15 Mar 2013 04:39 PM
ok, now how do i get it to rise and fall between these altitudes:

High: 30.600
Low: 29.600

i know its only one stud, but thats the only margin for movement, by reason of the bottom of the boats and the floors inside them
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