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!
So it doesnt move foward -
What is the issue? Include screenshots / videos if possible!
It moves up and down but also foward?
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I havent found any
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- Platform Script
local speed = 20
local start = script.Parent:WaitForChild("Start")
local finish = script.Parent:WaitForChild("Finish")
local attach0 = Instance.new("Attachment")
attach0.CFrame = CFrame.new()
attach0.Parent = script.Parent
local attach1 = Instance.new("Attachment")
attach1.CFrame = finish.CFrame
attach1.Parent = game.Workspace.Terrain
local pris = Instance.new("PrismaticConstraint")
pris.ActuatorType = Enum.ActuatorType.Motor
pris.MotorMaxForce = math.huge
pris.Attachment0 = attach1
pris.Attachment1 = attach0
pris.Parent = script.Parent
local up = true
pris.Velocity = speed
attach1.CFrame = finish.CFrame
start.Touched:Connect(function(hit)
if (hit == script.Parent and not up) then
up = true
pris.Velocity = speed
attach1.CFrame = finish.CFrame
end
end)
finish.Touched:Connect(function(hit)
if (hit == script.Parent and up) then
up = false
pris.Velocity = speed
attach1.CFrame = start.CFrame
end
end)
--156.314, 4701.603, 402.024 Start Position
--157.314, 4801.603, 402.024 Finish Position
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.