You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
The video.
-
What is the issue? Include screenshots / videos if possible!
The part keeps appearing under the map.
(Sorry for bad quality my PC sucks)
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried looking at dev-forum posts but it didn’t help.
Code:
local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local held = false
local p = workspace:WaitForChild("Part")
local start = p.CFrame
function update()
local pos = mouse.Hit.Position
local distance = (start.Position - pos).magnitude
if distance > 1000 then
distance = 1000
end
p.Size = Vector3.new(p.Size.X, p.Size.Y, distance)
p.CFrame = CFrame.new(Vector3.new(start.Position.X, .5, start.Position.Z), Vector3.new(pos.X, pos.Y, pos.Z)) * CFrame.new(0, 0, -distance / 2)
end
tool.Activated:Connect(function()
held = true
while held == true do
wait()
update()
end
end)
tool.Deactivated:Connect(function()
held = false
end)