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

Why is the bottle still going 'Haywire'?

Asked by 7 years ago

I've tried multiple times, altering rotation axis etc.... body velocity etc...

but with the bottle , this keeps happening https://www.youtube.com/watch?v=81fC1N6wiXQ&feature=youtu.be

ive even deleted the grey part in the video so that isnt affecting it.

--variables
secs = 0
ply = game.Players.LocalPlayer
mouse = ply:GetMouse()
rise = false
part = game.Workspace.WBM.Union
secs = 0.3
win = false
fall = false

--NEED TO EDIT PROPERTY OF PART2 TO MAKE IT HAVE NO EFFECT ON BOTTLE

--creates function
function Up()
    part.CFrame = part.CFrame + Vector3.new(0,secs,0)
end







--leftROTATON

function Leftmove()
    part.CFrame = part.CFrame * CFrame.Angles(0.1,0,0)
end

function LeftDown()--need to have this to mantain anchor, but have down motion
    part.CFrame = part.CFrame * CFrame.Angles(0.1,0,0)
    part.CFrame = part.CFrame - Vector3.new(0,0.1,0)
end







--RightRotation



--creates loop
while true do
mouse.Button1Down:connect(function()
    rise = true
    fall = false
    part.Anchored = true 
end)

mouse.Button1Up:connect(function()
    rise = false
    fall = true
    part.Anchored = false
end)

if rise == true and fall == false then--up motion
    Up()
    Leftmove()
else if rise == false and fall == true then 
    LeftDown()--down motion

end

game.Workspace.WBM.Union.Touched:connect(function(hit)
    local find = hit.Parent:FindFirstChild("top")
    if find ~= nil then
        part.CFrame = CFrame.new(12.37, 2.98, -19.72)
        win = false
        part.Anchored = true
        rise = false
        fall = false
        wait(0.01)
    else
        win = true
    end
end) --- need to use variable, left from movement script somehow

wait(0.01)
end
wait()
end


Answer this question