Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is wrong with this script? The objective is to make a wave effect of the sand.

Asked by 4 years ago
while true do
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.9, 999.9)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.8, 999.8)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.7, 999.7)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.6, 999.6)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.5, 999.5)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.4, 999.4)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.3, 999.3)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.2, 999.2)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.1, 999.1)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999, 999)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.1, 999.1)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.2, 999.2)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.3, 999.3)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.4, 999.4)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.5, 999.5)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.5, 999.6)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.7, 999.7)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.8, 999.8)
    wait(1)
    script.Parent.Size = Vector3(3.75, 999.9, 999.9)
    wait(1)
    script.Parent.Size = Vector3(3.75, 1000, 1000)
end
0
You forgot to use .new change Vector3 to Vector3.new User#5423 17 — 4y
0
This is a lot of code duplication I would look at using a table User#5423 17 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

first of all, stop writing too much, use a variable to make it a little easier:

var part = script.Parent;

while true do
    wait(1)
    part.Size = Vector3(3.75, 999.9, 999.9)
    wait(1)
   part.Size = Vector3(3.75, 999.8, 999.8)
end

and you forgot .new after vector3. Do this

var part = script.Parent;

while true do
    wait(1)
    part.Size = Vector3.new(3.75, 999.9, 999.9)
    wait(1)
   part.Size = Vector3.new(3.75, 999.8, 999.8)
end
Ad

Answer this question