Hello!
I have just started learning to tween and I had found a tutorial to tween in a server script. Now the problem is, I want the tween in a local script, but if I put this code in a local script it doesn’t work anymore (and it doesn’t give any errors too)
Can someone explain me how I could make this server tween into a local tween or if its even possible?
Here is the script I have:
local part = script.Parent
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
1, --Time the tween runs
Enum.EasingStyle.Linear, --The Easing Style of the tween
Enum.EasingDirection.Out, --The EasingDirection of the tween
0, --How many times the tween repeats
false, --if the tween will reverse
0 --How long it takes until the tween starts
)
local tween = TweenService:Create(part, tweenInfo, {Color = Color3.fromRGB(0, 255, 0)})
script.Parent.Touched:Connect(function(hit)
tween:Play()
script.Parent.Color:Destroy()
end)
Thanks for reading this and hopefully you can help me