#How to slowly change the transparency of an object

3 messages · Page 1 of 1 (latest)

dense mural
#

I'm trying to make a screen that slowly fades in from black until it reaches 0 transparency and then it needs to stop. This howver doesnt work and i cant figure out why. This is the code ive written so far:

local EnteredPC = game.ReplicatedStorage:WaitForChild("EnteredPC")
local prompt = script.Parent.ProximityPrompt
local transparency = 1
local decal = script.Parent.Decal
prompt.Triggered:Connect(function(player)
EnteredPC:FireClient(player)
while transparency >= 0 do
math(transparency-0.1)
decal.Transparency = transparency
wait(0.1)
end
end)

#

Nevermind

#

just figured it ouy