Object is a string. it has no properties. Did you mean to change the rotation of the Gradient? if so, you would need to define it and set the .Rotation in your code.
Edit: Don’t forget that modulescripts do not run on their own. They must be required by another script.
local module = {} -- define module table
function module.rotate(gradient, newRot) -- create function
gradient.Rotation = newRot
end
return module -- return module table
In the rotate function, you define the gradient and what you want to to rotate by. Here is example usage:
local module = require(whereveryourmoduleis) --modulescripts are usally held in replicatedstorage
local gradient = whereeveryourgradientis
local runservice = game:GetService("RunService")
runservice.Heartbeat:Connect(function()
module.rotate(gradient, gradient.Rotation + 1)
end)
.Heartbeat is a runservice function that runs a function every frame. for example, if you connected a function like this:
local func = function()
print("Hi")
end
And then connected it to heartbeat like so:
RunService.Heartbeat:Connect(func) -- or whatever you named the function
then your output will then print “Hi” every frame (basically a very fast loop with no yielding)
Edit: Renderstepped and heartbeat are pretty similar and are interchangable. Renderstepped runs before each frame, Heartbeat runs after each. This shouldn’t matter for small things such as spinning a gui’s color.