#Move block with Gui
5 messages · Page 1 of 1 (latest)
i use this script in imagebutton:
local TweenService = game:GetService("TweenService")
local block = game.Workspace:WaitForChild("oppa")
local function moveRight()
local originalPosition = block.Position
local info = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local goal = {Position = originalPosition + Vector3.new(10, 0, 0)}
local tween = TweenService:Create(block, info, goal)
tween:Play()
end
script.Parent.MouseButton1Click:Connect(moveRight)
---------------------- (oppa is the name of the block)
The way to do that would be using velocity instead of plain cframing