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

Moving parts postion not working correctly?

Asked by
Plieax 66
6 years ago
local module = {}

function module.tweenpartpos (part,newx,newy,newz,partspeed)
    local newpos = Vector3.new(newx,newy,newz)
    local interval = .01
    local currentx = part.Position.X    
        local currenty = part.Position.Y
            local currentz = part.Position.Z
                           local intervalforx = newx - currentx

    for i = 1,intervalforx/.001,1 do
        part.Postion = part.Position + Vector3.new(.01,0,0)
    end     

end

return module


What i am after is making the part tween, on line 12 i am having an error the for i = 1,intervalforx,1 loop is for the x position of the part, how do i fix?

0
Error? Creeperman1524 120 — 6y
0
14:38:32.653 - Script 'Workspace.Serverstartscripts.ModuleScript', Line 12 - field tweenpartpos Plieax 66 — 6y

Answer this question