What should I do for this?

Hey guys. I’d like to make a part go transparent within one second. However, the game.Workspace:GetServerTimeNow() function returns a very big number. Is there a way to make it a smaller number?

local function MakePartTransparent(Part)
	RunService.Heartbeat:Connect(function(deltaTime)
		Part.Transparency += game.Workspace:GetServerTimeNow()
		print(Part.Transparency)
	end)
end

The goal is to make the part’s transparency 1 in exactly one second. The number is too big when using game.Workspace:GetServerTimeNow() which causes the part to go transparent instantly.

Why are you trying to do it like this? Try using TweenService instead.

what is this??

use Tween Service for such things, here’s an example:

local TweenService = game:GetService("TweenService")

local TweenDuration = 1

local function Tween(instance, goal)
   TweenService:Create(instance, TweenInfo.new(TweenDuration), goal):Play()
end 

Tween(Part, {Transparency = 1})

You can learn tweening more detailed from here

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.