Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is this blender script correct? Need help with this script.

I would like to make item givers and stuff like in many cafe typed games. I can make item givers but I would like to make a Blender, something like;

Cup(item) -> Ice machine -> Blender.

I want the blender to take sometime and change the colour. This script doesn't work. How do I fix this.

function tch(h)
if (h.Parent.Name == "Anything") then -- Same thing ^^^^
h.Parent.Name = "Blending..." -- Not this one.
script.Parent.Sound:Play()
script.Parent.Parent.Part1.BrickColor = h.Parent.Handle.BrickColor
script.Parent.Parent.Part2.BrickColor = h.Parent.Handle.BrickColor
script.Parent.Parent.Part3.BrickColor = h.Parent.Handle.BrickColor
script.Parent.Parent.Part4.BrickColor = h.Parent.Handle.BrickColor
script.Parent.Parent.Part5.BrickColor = h.Parent.Handle.BrickColor
script.Parent.Parent.Part6.BrickColor = h.Parent.Handle.BrickColor
script.Parent.Parent.Part7.BrickColor = h.Parent.Handle.BrickColor
script.Parent.Parent.Part8.BrickColor = h.Parent.Handle.BrickColor
script.Parent.Parent.Part9.BrickColor = h.Parent.Handle.BrickColor
wait(0.1)
script.Parent.Parent.Part8.Transparency = 0
script.Parent.Parent.Part9.Transparency = 1
wait(0.1)
script.Parent.Parent.Part7.Transparency = 0
script.Parent.Parent.Part8.Transparency = 1
wait(0.1)
script.Parent.Parent.Part6.Transparency = 0
script.Parent.Parent.Part7.Transparency = 1
wait(0.1)
script.Parent.Parent.Part5.Transparency = 0
script.Parent.Parent.Part6.Transparency = 1
wait(0.1)
script.Parent.Parent.Part4.Transparency = 0
script.Parent.Parent.Part5.Transparency = 1
wait(0.1)
script.Parent.Parent.Part3.Transparency = 0
script.Parent.Parent.Part4.Transparency = 1
wait(0.1)
script.Parent.Parent.Part2.Transparency = 0
script.Parent.Parent.Part3.Transparency = 1
wait(0.1)
script.Parent.Parent.Part1.Transparency = 0
script.Parent.Parent.Part2.Transparency = 1
wait(0.1)
script.Parent.Blend:Play()
wait(4.5)
h.Parent.Name = "Pouring..."
script.Parent.Sound:Play()
wait(0.1)
script.Parent.Parent.Part1.Transparency = 0
wait(0.1)
script.Parent.Parent.Part2.Transparency = 0
script.Parent.Parent.Part1.Transparency = 1
wait(0.1)
script.Parent.Parent.Part3.Transparency = 0
script.Parent.Parent.Part2.Transparency = 1
wait(0.1)
script.Parent.Parent.Part4.Transparency = 0
script.Parent.Parent.Part3.Transparency = 1
wait(0.1)
script.Parent.Parent.Part5.Transparency = 0
script.Parent.Parent.Part4.Transparency = 1
wait(0.1)
script.Parent.Parent.Part6.Transparency = 0
script.Parent.Parent.Part5.Transparency = 1
wait(0.1)
script.Parent.Parent.Part7.Transparency = 0
script.Parent.Parent.Part6.Transparency = 1
wait(0.1)
script.Parent.Parent.Part8.Transparency = 0
script.Parent.Parent.Part7.Transparency = 1
wait(0.1)
script.Parent.Parent.Part9.Transparency = 0
script.Parent.Parent.Part8.Transparency = 1
wait(0.1)
script.Parent.Parent.Part9.Transparency = 1
h.Parent.Name = "Change to anything!" -- Anything
wait(0.5)
end
end

script.Parent.Touched:connect(tch)

Once I insert the cup or whatever, it's stuck at "blending" and wouldn't show any music or stuff... Please help.

Thank you.

3 comments

0

Please explain me on how the above script works. Thank you.

0

Don't take this the wrong way but the above script looks pretty inefficient, try using for loops and tables to save space.

0

dont ask us to fix free models

1 answer

Simply add a debounce to lines 1,3 and 73:

Line 1:

bool = true

Line 3:

bool = false

Line 73:

bool = true

Because there is no debounce in your script, the function will continue to run as long as it is continuously called. Debounce stops the function after running once.

This discussion is preserved as it was. New answers, comments, and votes are closed.