BGamers11
|
  |
| Joined: 03 Nov 2016 |
| Total Posts: 33 |
|
|
| 26 Sep 2017 02:31 PM |
| So, I was trying to upgrade my roblox lua abilities trying to make my own flood escape that I'll totally not use to try to copy flood escape, and I actually found something weird: So, the water can't collide, and I made it to increases it size, but it's so weird that when the water touches a player, just a player, like me, it teleports to the highest place without bricks possible, like, it can't collide but when it ####### ## it thinks it needs to collide or what? So weird... I can send a video case necessary, but why the water part do such weird thing? (Note: it actually don't happens if I take out of my script the part of: humanoid.Touched:connect(part) like just when I connect the player to a part, if the water touches the player, the water go above of everything...) |
|
|
| Report Abuse |
|
|
| |
|
BGamers11
|
  |
| Joined: 03 Nov 2016 |
| Total Posts: 33 |
|
|
| 26 Sep 2017 02:42 PM |
| It is anchored or it would fall, it not starts being vectored3 |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2017 02:46 PM |
| well if your trying to move a part you should just require a simple CFrame *CFrame.new script |
|
|
| Report Abuse |
|
|
BGamers11
|
  |
| Joined: 03 Nov 2016 |
| Total Posts: 33 |
|
|
| 26 Sep 2017 02:52 PM |
| So I think I'll need to use CFrame instead of Vector3 .-. |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2017 02:59 PM |
here's a quick example
-- Code --
while true do script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,0,0) --(X,Y,Z) wait(0.1) end
-- Code -- |
|
|
| Report Abuse |
|
|
BGamers11
|
  |
| Joined: 03 Nov 2016 |
| Total Posts: 33 |
|
|
| 26 Sep 2017 03:07 PM |
| Can you tell me a final thing? Should I use while, repeat until or for? because I tested them and each one repeat things at diferent speeds |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2017 03:12 PM |
while true do just continuously runs the code
repeat until runs the code in sequence until a condition is met
i don't personally have much experience with For loops so i couldn't say |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2017 03:16 PM |
personally it all depends on how you want your water to rise
if you want it to continuously rise without a break then you probably should use while true do
if you want it to rise then wait then rise again as a different level then wait and rise again then you should probably use the repeat until loop |
|
|
| Report Abuse |
|
|
soutenu
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 1021 |
|
|
| 26 Sep 2017 03:22 PM |
@judess that's not how while loops work at all, here's a more clear example:
while(condition)do --code end;
while(true)do print'a'; end;
OUTPUT: a a a a...
while(false)do print'b'; end;
OUTPUT:
why? because in Lua anything other than nil or false validates a condition |
|
|
| Report Abuse |
|
|
soutenu
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 1021 |
|
|
| 26 Sep 2017 03:26 PM |
@judess my point is, you could use a while loop as well:
while(water.Size~=Vector3.new(20,100,20) and wait() do --code end; |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2017 03:28 PM |
| well that's kind of self explanatory about the "true" part of the while true do loop of course setting it to false is going to be like turning a light switch off |
|
|
| Report Abuse |
|
|
|
| 26 Sep 2017 03:33 PM |
@soutenu
the reason i kept it simple is cause i don't exactly know his Scripting Experience and i don't really wanna throw him some code that's out of his scripting level
sure your way will work fine but its more of an intermediate loop |
|
|
| Report Abuse |
|
|