I can't get this to work
#2
Vec2Ds can't be subtracted or added from each other.

[lua]
parent=script.Parent

amount= Vec2D(1,1)
mx=Vec2D(5,5)
mn=Vec2D(0,0)
time=0.1

type="rise"

function rise()
parent.Size = parent.Size:add(amount)
end

function lower()
parent.Size = parent.SizeConfusedub(amount)
end

function loop()
print(type)
if (type=="rise") and (parent.Size.x <= mx.x and parent.Size.y <= mx.y) then
type="lower"
elseif (type=="rise") then
rise()
elseif (type=="lower") and (parent.Size.x >= mn.x and parent.Size.y >= mn.y) then
type="rise"
elseif (type=="lower") then
lowerTide()
end end

while true do
sleep(time)
loop()
end
[/lua]

Reply


Messages In This Thread
I can't get this to work - by Dignity - 07-15-2012, 11:59 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)