Hello, so I want to make two GUI's Tween when the Character joins the game for my main menu. ( * Note that the ScreenGUI is the same name as the Frame * ) Here is my script so far:
-- Local Script
local Welcome = script.Parent:WaitForChild("MainMenu").Welcome
local NHW = script.Parent:WaitForChild("MainMenu").NoobsWhoWish
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local RS = game.ReplicatedStorage
local TweenEvent = RS.RemoteEvents:WaitForChild("MenuTween")
-- Variable's
TweenEvent.OnClientEvent:Connect(function(plr)
local success, errorMgs = pcall(function()
Welcome:TweenPosition(
UDim2.new(0.213, 0,0.022, 0),
"Out",
"Quad",
1,
false,
nil
)
wait(2)
NHW:TweenPosition(
UDim2.new(0.194, 0,0.086, 0),
"Out",
"Quad",
2,
false,
nil
)
end)
if success then
print("The Main Menu Tween was a Success!")
else
warn("The Main Menu Tween was UnSuccessful!: "..errorMgs)
end
end)
--Server-Script
local playerService = game:GetService("Players")
local TweenEvent = game.ReplicatedStorage.RemoteEvents:WaitForChild("MenuTween")
playerService.PlayerAdded:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
plr.CharacterAdded:Connect(function(char)
wait(5)
TweenEvent:FireClient(plr)
end)
end)
If you find a solution, please feel free to comment below! Have a nice rest of your day/night/ morning!
