Make speed change from a NumberValue

I’m trying to make it so it changes anytime a button is pressed so the number value will go up, therefore the speed of a spinner with be faster. But it doesn’t work when the value is edited while playing, How can I fix this?

This is my code

while true do
local speed = script.Parent.Speed.Value
script.Parent.CFrame = script.Parent.CFrame*CFrame.fromEulerAnglesXYZ(0,speed,0)
wait(0.0)
end

where are you changing the value? you need to change it on the server (I assume the script is on the server). if you manually change it in the properties tab, I’m pretty sure it only changes on the client

Why is wait set to 0 do atleast 0.001 or dont put any value

It is probably speeding up. However, it’s likely that it’s already too fast to tell a difference.

I’m assuming your “Speed” value is an integer. CFrame.fromEulerAnglesXYZ uses radians, so having it increase by 1 radian per frame per click is extremely fast. Instead, try:

script.Parent.CFrame*CFrame.fromEulerAnglesXYZ(0,math.rad(speed),0)

it’s the same as task.wait(), it has a minimum

Right now, first use runservice as while true do can xause performance issues, second use math.rad(speed), third use a client script or switch to server before changing value