this is my code, (ik not very efficient) and everything works but for some reason the conveyors keep going. Even after I disable them, they dont stop moving. Anyone know why?
Can you paste your script? Also, what do you mean by disabling them?
Where do you disable the script?
Is this the script for the conveyors or the enable/disable?
under the wait 10 and saw part, "conveyor.Conveyor.Script.Enabled = false
conveyor.Conveyor2.Script.Enabled = false
conveyor.Conveyor3.Script.Enabled = false"
Could you paste those scripts too?
local saw = script.Parent.Parent
local conveyor = script.Parent.Parent
function onClicked()
script.Parent.Click:Play()
script.Parent.ClickDetector.MaxActivationDistance = 0
saw.SpinnyScript.Enabled = true
conveyor.Conveyor.Script.Enabled = true
conveyor.Conveyor2.Script.Enabled = true
conveyor.Conveyor3.Script.Enabled = true
wait(10)
saw.SpinnyScript.Enabled = false
conveyor.Conveyor.Script.Enabled = false
conveyor.Conveyor2.Script.Enabled = false
conveyor.Conveyor3.Script.Enabled = false
script.Parent.ClickDetector.MaxActivationDistance = 32
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
> Blockquote
i just mean this part
///////////////////////////////
Just because you disable a script, doesnt mean the affects of that script have stopped.
That is why everyone is asking to see the script.
Something in the script is starting the conveyor process, and when you disable them, the
process is continuing.
yes so im asking how can i stop it
you need to look inside the conveyor.Conveyor.Script
and show us the contents of that script
ohhhhhh okay
local Speed = script.Parent.Speed.Value
while true do
script.Parent.Velocity = script.Parent.CFrame.LookVector*Speed
wait(0.1)
end
So instead of enabling/disabling the script just change the conveyor Speed value.
Don’t use a whole true do loop though. Just change it when the clickdetector function is called.
what can i do instead of a while true do loop tho? because when i change the speed value in the script it doesnt change it, and if i dont use a loop it just doesnt move
In created a little example place, that uses Attributes to control the conveyor speed.
Conveyor_Example.rbxl (42.8 KB)
See if you can understand what is happening in this example, and if it will work with what you are doing.
Thank you!! This helped me figure it out.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.