-
What do you want to achieve? Keep it simple and clear!
I am making a conveyor system for my game it works well but there’s a problem -
What is the issue? Include screenshots / videos if possible!
Basically in the game you can spawn and customize a part and then send it into a conveyor to get money, when I activate the conveyor and then spawn a part on top of it, it works. but when I spawn the part first and enable the conveyor the part doesn’t move as you can see in this video
so if anyone got solution to how I can make the part move when it spawn first and then enable the conveyor please tell
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Speed = script.Parent.Conveyor:GetAttribute("Speed")
local Button = script.Parent.Operator.Button
local debouce = false
local Moving = false
local ConveyorFolder = script.Parent.Conveyor.ConveyorPart
local Tween1
local Tween2
local function MoveTexture(Texture)
local info = TweenInfo.new(45, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1)
Tween1 = TweenService:Create(Texture, info, {OffsetStudsV =- 300})
Tween1:Play()
end
Button.ClickDetector.MouseClick:Connect(function()
if debouce == false then
debouce = true
if Moving == false then
Moving = true
MoveTexture(ConveyorFolder.Conveyor1.Texture)
for i, v in pairs(ConveyorFolder:GetChildren()) do
v.AssemblyLinearVelocity = v.CFrame.LookVector * Speed
end
Button.SurfaceGui.TextLabel.Text = "Stop"
Button.Color = Color3.fromRGB(255, 89, 89)
else
Moving = false
if Tween1 ~= nil then
Tween1:Cancel()
end
for i, v in pairs(ConveyorFolder:GetChildren()) do
v.AssemblyLinearVelocity = Vector3.new(0,0,0)
end
Button.SurfaceGui.TextLabel.Text = "Send"
Button.Color = Color3.fromRGB(75, 151, 75)
end
wait(0.5)
debouce = false
end
end)