Hey, it’s been a while since I posted and on my most recent game I am trying to code a zoning system, I have already completed the basic part and I just need to tween the transparency (if possible) in and out. My code is very messy because this is one of the first times I’ve coded and I’m using Roblox’s documentation and tutorials as my main. (Sorry coders who know 1000x more efficient ways)
local event = game.ReplicatedStorage:WaitForChild("Aves")
local UI = game.Players.LocalPlayer.PlayerGui:WaitForChild("Area")
local indicator = UI.Aves_Image
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(5)
event.OnClientEvent:Connect(function(inOrOut)
if(inOrOut == "In") then
local tween1 = TweenService:Create(UI.Aves_Image, TweenInfo, {Transparency = .0})
indicator.Visible = true
local tween1 = TweenService:Create(UI.Aves_Image, TweenInfo, {Transparency = 1})
wait(5) indicator.Visible = false
local tween1 = TweenService:Create(UI.Aves_Image, TweenInfo, {Transparency = .0})
else
indicator.Visible = false
end
end)
tween1:Play()
tween2:Play()
(I do have another script that’s connecting to this, if you might need that to help I can give it.