Hey, so i’m trying make this little spaceship minigame prototype and you can turn on these head lights. But when you load up the game it automatically spits out a error saying:
‘‘TweenService:Create property named ‘Material’ cannot be tweened due to type mismatch (property is a ‘int’, but given type is ‘token’)’’.
This is at Line 13 of the code and I can’t figure out why its giving it so I’m hoping you guys can help me (also sorry if the variables or code is messy, I’m making this game just for fun so I don’t worry much about how the code looks :D)
local Light = script.Parent --This is a part/basepart
local TS = game:GetService("TweenService")
local TI = TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut, 0, false, 0)
local value = game.ReplicatedStorage.HeadlightsOnOff
local goalOn = {
Material = Enum.Material.Neon
}
local goalOff = {
Material = Enum.Material.Cobblestone
}
local TweenOn = TS:Create(Light, TI, goalOn)
local TweenOff = TS:Create(Light, TI, goalOff)
--the stuff below here dont matter but might as well add just in case
value.Changed:Connect(function()
if value.Value == true then
TweenOn:Play()
else
TweenOff:Play()
end
end)
