Can you please help me? I have a script i want to make so when you click it, it shrinks and i know you put a click detector somewhere too. I don't want it to already be shrinking when i join the game. I already have this...
p=game.Workspace.Dirt
p.Size=Vector3.new(8,8,8) wait(1) p.Size=Vector3.new(7,7,7) wait(1) p.Size=Vector3.new(6,6,6) wait(1) p.Size=Vector3.new(5,5,5) wait(1) p.Size=Vector3.new(4,4,4) wait(1) p.Size=Vector3.new(3,3,3) wait(1) p.Size=Vector3.new(2,2,2) wait(1) p.Size=Vector3.new(1,1,1)
Dirt is the brick im trying to shrink. I just need to make it so when you click it, it runs this command.
First of all, separate your code. Add a click detector with this script as its child.
script.Parent.ClickDetector.MouseClick:connect(function() -- when clicked, do this: p=game.Workspace.Dirt if p.Size = Vector3.new(9,9,9) -- this only works if the size of the dirt is 9x9x9 p.Size=Vector3.new(8,8,8) wait(1) p.Size=Vector3.new(7,7,7) wait(1) p.Size=Vector3.new(6,6,6) -- 666 :o wait(1) p.Size=Vector3.new(5,5,5) wait(1) p.Size=Vector3.new(4,4,4) wait(1) p.Size=Vector3.new(3,3,3) wait(1) p.Size=Vector3.new(2,2,2) wait(1) p.Size=Vector3.new(1,1,1) end end)