Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Moving a part up and down without it being interruped?

So right now my part moves up and down when i press the GUI for it but when i collide or touch with the moving part, it will move aside and bug out. I just want that it wont get interruped. is there a better way to move a part?

local GUI = script.Parent
local Pic = GUI.Pic
local text = Pic.Text
GUI.Adornee = workspace.Pillar1

hack = false

function HACK()
	if hack == false then
local hackobj = game.workspace.Pillar1.HackObj
for i = 1,17 do
	hackobj.Position = hackobj.Position + Vector3.new(0,-0.25,0)
	wait(0.03)
end
hack = true	
	else
	local hackobj = game.workspace.Pillar1.HackObj
for i = 1,17 do
	hackobj.Position = hackobj.Position + Vector3.new(0,0.25,0)
	wait(0.03)
end
hack = false

end
end


Pic.MouseButton1Down:connect(HACK)

2 comments

0

you can use collision groups or use cframe instead of position

0

try cframe

3 answers

Since you are manipulating the parts position using vecto3 instead of bodyvelocity, this should work:

local GUI = script.Parent
local Pic = GUI.Pic
local text = Pic.Text
GUI.Adornee = workspace.Pillar1

hack = false

function HACK()
    if hack == false then
local hackobj = game.workspace.Pillar1.HackObj
hackobj.Anchored = true --here is the changed code
for i = 1,17 do
    hackobj.Position = hackobj.Position + Vector3.new(0,-0.25,0)
    wait(0.03)
end
hack = true 
    else
    local hackobj = game.workspace.Pillar1.HackObj
hackobj.Anchored = true --here is the changed code
for i = 1,17 do
    hackobj.Position = hackobj.Position + Vector3.new(0,0.25,0)
    wait(0.03)
end
hack = false

end
end

3 comments

0

New problem. Is there a way that the part moves trough other parts? like goes inside a brick? but the player is still solid to it?

0

You could CollisionGroups for that.

0

It should go inside a brick no problem since it is anchored

You need to use CFrame instead of Position.

local GUI = script.Parent
local Pic = GUI.Pic
local text = Pic.Text
GUI.Adornee = workspace.Pillar1

hack = false

function HACK()
    if hack == false then
local hackobj = game.workspace.Pillar1.HackObj
hackobj.Anchored = true
for i = 1,17 do
    hackobj.CFrame = hackobj.CFrame * CFrame.new(0,-0.25,0)
    wait(0.03)
end
hack = true 
    else
    local hackobj = game.workspace.Pillar1.HackObj
hackobj.Anchored = true
for i = 1,17 do
    hackobj.CFrame = hackobj.CFrame * CFrame.new(0,0.25,0)
    wait(0.03)
end
hack = false

end
end

Just Use F3X it will help you with anything, moving tools, stuff its way better.****

2 comments

0

What does a building tool have to do with his scripting problem?

0

true..

This discussion is preserved as it was. New answers, comments, and votes are closed.