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

The block isnt going into the posistion its needed in?

Asked by 6 years ago
Edited 6 years ago

Heres the script:

local clickdetector = script.Parent
clickdetector.MouseClick:Connect(function(player) -- registers the click
    while true do -- from here its just to code
        game.Workspace.OHHH.Position = Vector3.new(-16.3, 0.5, -10.5)

        wait(3)
        game.Workspace.OHHH.Position = Vector3.new(-16.4, 0.5, -8.8)
        wait(3)
    end
end)

so basically this script is linked to a Click Detector and when I click it, the block goes above into the air and not in the ground like its supposed to, help!

0
Does the position you are trying to set the part to also happen to force it to collide with another part? SummerEquinox 643 — 6y
0
yes Adenandpuppy 87 — 6y
0
Set CanCollide = false while setting the position, and once the position is set, you can make it true again. SummerEquinox 643 — 6y
0
you do realize you could just use clickdetector.MouseClick:Wait()? Bisoph 5 — 6y

1 answer

Log in to vote
1
Answered by
Vain_p 78
6 years ago

Try replacing the Position with a CFrame

Exmple:

local clickdetector = script.Parent
clickdetector.MouseClick:Connect(function(player) 
    while true do
        game.Workspace.OHHH.CFrame = CFrame.new(-16.3, 0.5, -10.5)

        wait(3)
        game.Workspace.OHHH.CFrame= CFrame.new(-16.4, 0.5, -8.8)
        wait(3)
    end
end)

0
thanks! Adenandpuppy 87 — 6y
0
np Vain_p 78 — 6y
Ad

Answer this question