I have a transition Fade script and it works when a player joins the game, but when a player is refreshed, it doesn’t work. My assumption is that the “Fade and Fade2” values don’t change with the player refreshing. Any help is appreciated.
If it helps, this is a local script in “ReplicatedFirst”.
local Event = game:GetService("ReplicatedStorage"):WaitForChild("BlackFade")
local Player = game:GetService("Players").LocalPlayer
local theplayer = game.Players.LocalPlayer
local Fade = Player:WaitForChild("PlayerGui"):WaitForChild("BlackFade").tframe
local Fade2 = Player:WaitForChild("PlayerGui"):WaitForChild("WhiteFade").tframe
local Info = TweenInfo.new(3)
local Info2 = TweenInfo.new(9)
local tween = game:GetService("TweenService"):Create(Fade,Info,{BackgroundTransparency=0})
local tween2 = game:GetService("TweenService"):Create(Fade2,Info,{BackgroundTransparency=0})
local closetheshopup = game:GetService("TweenService"):Create(Fade2,Info2,{BackgroundTransparency=1})
local paryers = {}
local AliveTeam = game.Teams.Alive
Event.OnClientEvent:Connect(function()
Fade.Visible = true
tween:Play()
tween.Completed:Wait()
Fade.Transparency = 1
wait(18)
Fade2.Visible = true
tween2:Play()
tween2.Completed:Wait()
wait(1)
for i, player in pairs(AliveTeam:GetPlayers()) do
if player then
table.insert(paryers,player)
end
end
for i, player in pairs(paryers) do
if player then
player.CameraMode = Enum.CameraMode.LockFirstPerson
end
end
closetheshopup:Play()
closetheshopup.Completed:Wait()
Fade.Visible = false
Fade2.Visible = false
end)