Help with creating lava spinner that speeds up with time

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    A function where the lava spinner (sweeper) gradually increases as time passes.

  2. What is the issue? Include screenshots / videos if possible!

I’m currently working on a prototype minigame, called the Lava Spinner, currently It’s controlled manually to where I can press a button to start the spinner, and one which ends it, however I’d like to make it so that the spinner starts slow and gradually increases as time passes.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I’ve spent over 10 hours so far, setting variables, renaming objects, rescripting but nothing seemed to work, it’d be greatly appreciated if someone could guide me step by step as what I am supposed to do or come in studio and take a look at the code, I used to script Lua a few years back, however I’ve mostly forgotten how to script in basic Lua form. I’m more professional at HTML, JS and Python.

3 Likes

What method are you currently using to spin the object? What is your current script that causes it to spin?

Please post it with back ticks so appears as code, thanks.

I’ve restarted my code since it wasn’t getting me anywhere, here is my current code:

local OriginalCFrames = {}
for _,Obj in pairs(workspace[“The Sweeper”]:GetChildren()) do
if Obj:IsA(“BasePart”) then
OriginalCFrames[Obj] = Obj.CFrame
end
end

function onClick(click)
script.Parent.Parent.BrickColor = BrickColor.new(“Really red”)
workspace[“The Sweeper”].Sweeper.Spin.Disabled = true
for Block,CF in pairs(OriginalCFrames) do
Block.CFrame = CF
end
end

script.Parent.MouseClick:connect(onClick)

Blockquote

This makes it spin? From the looks of it this just makes it set its CFrame to what it already is.

My bad, the whole script didn’t post, here is the updated version:

SPIN:

spinning.CFrame = spinning.CFrame * CFrame.fromEulerAnglesXYZ(0, math.rad(10.5), 0)
wait(0.00)
end ```

SPIN STARTS:

```local OriginalCFrames = {}
for _,Obj in pairs(workspace["The Sweeper"]:GetChildren()) do
	if Obj:IsA("BasePart") then
		OriginalCFrames[Obj] = Obj.CFrame
	end
end

function onClick(click) 
	script.Parent.Parent.BrickColor = BrickColor.new("Really red")
	workspace["The Sweeper"].Sweeper.Spin.Disabled = false
	for Block,CF in pairs(OriginalCFrames) do
		Block.CFrame = CF
	end
end

script.Parent.MouseClick:connect(onClick)

``` This starts on the press of a button.
1 Like

Can you post a GIF of you clicking the button? I want to see the spinning, it doesn’t look like this code is actually causing it to rotate.

1 Like

Duplicate made, but keeping that one as it has received more input.