Hello! So, I am trying to make a button system via Attributes feature. But, the tween is not working, I made sure the properties and attributes are right. I debugged via print() and made sure everything is working. (What I'm trying to do is make the crystal be white when touched.)
Here is the script:
local crystal = script.Parent
local OutputON = crystal:GetAttribute("OutputON")
local moduleSc = require(game.ReplicatedStorage.ModuleScript)
crystal.Touched:Connect(function(h)
if h.Parent:FindFirstChild("Humanoid") then
crystal:SetAttribute("OutputON", true)
local OutputON = crystal:GetAttribute("OutputON")
moduleSc.crystalTurnOn(OutputON,crystal)
end
end)
Here is the module script:
local module = {}
local ts = game:GetService("TweenService")
module.crystalTurnOn = function(attribute,part)
if attribute == true then
local tweenInfo = TweenInfo.new(
7,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In,
1,
false,
5
)
local tween = ts:Create(part,tweenInfo,{Color = Color3.fromRGB(255, 255, 255)})
tween:Play()
end
end
return module
Any help appreciated.

2 comments
that is not how you create a tween. use the normal way -_-
link me to a website that says the normal way