I have a script that has a TextLabel show up when you enter a part in workspace, and the text fades in and out, but the fade is rlly ugly. Any way I can make it clean?
Script works fine btw just the ugly fade.
local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local title = script.Parent.Title
local area = game.Workspace.Area
local toggle = false
while true do wait(1)
for i, section in pairs(area:GetChildren()) do
local pos1,pos2 = (section.Position - (section.Size / 2)),(section.Position + (section.Size / 2))
local region = Region3.new(pos1,pos2)
local playersFound = game.Workspace:FindPartsInRegion3(region)
for i, playersInArea in pairs(playersFound) do
if playersInArea:FindFirstAncestor(player.Name) then
toggle = true
if title.Text == section.Name then
else
title.Text = section.Name
title.Parent.Enabled = true
for i = 1,0,-0.1 do
title.TextTransparency = i
wait(0.2)
if i == 0 then
break
end
end
wait(1)
for i = 0,1,0.1 do
title.TextTransparency = i
wait(0.2)
if i == 1 then
break
end
end
end
else
toggle = false
end
end
end
end