Gui Tranparency Tween not working

  1. I what to make a gui that when a remote event fires it fades in the out using the tween service.

  2. The issus I am not sure what s wrong with this as there are not viewable errors
    and i dont think my other script is the problem because that is working fine with it all doing what I coded

  3. I have tried searching around about this but I could not find any good explanations

Local Script

local TweenService = game:GetService("TweenService") --tween service for tweening

script.Parent.Parent.MainFrame.MenuFrame.Teliport.OnClientEvent:Connect(function() --getting my remote event
	local screentweenInfo = TweenInfo.new(0.45, Enum.EasingStyle.Sine) --my tween info
	
	local screenFade0 = TweenService:Create(script.Parent, screentweenInfo, {BackgroundTransparency = 0})--tween part1
	local screenFade1 = TweenService:Create(script.Parent, screentweenInfo, {BackgroundTransparency = 1})--tween part 1
	
	screenFade0:Play()--running tween
	wait(0.1)--short delay
	screenFade1:Play()
end)

Thanks for the help

instead of using wait(.1) try waiting for tween to be completed using .Completed:Wait()

screenFade0:Play()
screenFade0.Completed:Wait()
screenFade1:Play()
screenFade1.Completed:Wait()

Edit: I just found out that your remote event is in the ui (i think) and not is ReplicatedStorage, remotes should be in a place where both the server and the client can reach

2 Likes

That shouldn’t be the problem considering that both client and server can see RemoteEvents inside PlayerGui folder.

I tried both of you suggestions but it still isn’t working but thanks for the help

Is the Gui visible? I mean is the visible property true?

Can you try adding some prints to debug your code. Is your remote being sent over?

local TweenService = game:GetService("TweenService")
local RemoteEvent = script.Parent.Parent.MainFrame.MenuFrame.Teliport
local Frame = script.Parent

RemoteEvent.OnClientEvent:Connect(function()
    TweenService:Create(Frame,TweenInfo.new(),{BackgroundTransparency = 0}):Play()
    wait(.1)
    TweenService:Create(Frame,TweenInfo.new(),{BackgroundTransparency = 1}):Play()
end)

lmao just rename the “Teliport” to “Teleport”

Anyways, that’s about it, you can improve some of your codes to prevent some future bugs.

Thanks I have and it seems like it isn’t running my code it might be soming to do with this

local script
game.ReplicatedStorage.Teliport:FireServer()

What is your server-sided code? Are you calling RemoteEvent:FireClient(yourPlayer)?

You were a sort of hint to the bit I missed out I replaced the script with a diffrent normal script in server script service

1 Like