I think that’s the script you’re looking for (I’m sending the whole code to make sure I didn’t miss something important):
task.wait()
local TweenService = game:GetService("TweenService")
local rs = game.ReplicatedStorage
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local mouse = player:GetMouse()
local currentCamera = workspace.CurrentCamera
local gui = script.Parent
local loadingframe = gui.Loading
local title = gui.Title
local play = gui.Play
local setting = gui.Settings
local credits = gui.Credits
local shop = gui.Shop
local loadout = gui.Loadout
local back2 = gui.Back2
local back3 = gui.Back3
local back4 = gui.Back4
local back5 = gui.Back5
local Black = gui.Black
--actual frames
local FLoadout = script.Parent.Frames.LoadoutFrame
local FSettings = script.Parent.Frames.SettingsFrame
local FCredits = script.Parent.Frames.CreditsFrame
local folder = workspace.MenuWorldAssets
local inMenu = true
local WhichCamera = 1
--[[ Humanoid thing cool
folder.Rig:WaitForChild("HumanoidRootPart")
character.HumanoidRootPart.CFrame = folder.Rig.HumanoidRootPart.CFrame
local loadR15 = character.Humanoid:LoadAnimation(folder.Settings.R15Idle)
loadR15.Priority = Enum.AnimationPriority.Action4
loadR15:Play()
local loadR6 = character.Humanoid:LoadAnimation(folder.Settings.R6Idle)
loadR6.Priority = Enum.AnimationPriority.Action4
loadR6:Play()]]
folder:WaitForChild("CameraPart")
local function SetMenuCamera()
repeat wait()
currentCamera.CameraType = Enum.CameraType.Scriptable
currentCamera.CFrame = folder.CameraPart.CFrame
warn("intialized camera", currentCamera)
until currentCamera.CFrame == folder.CameraPart.CFrame
end
SetMenuCamera()
local function UpdateUI(value)
for i, obj in pairs(gui:GetChildren()) do
if obj:IsA("SurfaceGui") then
if obj == script.Parent.Voting then
continue
else
obj.Enabled = value
end
elseif obj:IsA("Folder") then
for i, obj2 in pairs(obj:GetChildren()) do
if obj2:IsA("SurfaceGui") then
obj2.Enabled = value
end
end
end
end
end
local maxTilt = 10
game:GetService("RunService").RenderStepped:Connect(function()
if inMenu == true then
-- PC users support
if game:GetService("UserInputService").MouseEnabled and game:GetService("UserInputService").KeyboardEnabled then
if WhichCamera ==1 then
workspace.CurrentCamera.CFrame = folder.CameraPart.CFrame * CFrame.Angles(
math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -maxTilt),
math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -maxTilt),
0
)
elseif WhichCamera == 2 then
workspace.CurrentCamera.CFrame = folder.CameraPart2.CFrame * CFrame.Angles(
math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -maxTilt),
math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -maxTilt),
0
)
elseif WhichCamera == 3 then
workspace.CurrentCamera.CFrame = folder.CameraPart3.CFrame * CFrame.Angles(
math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -maxTilt),
math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -maxTilt),
0
)
elseif WhichCamera == 4 then
workspace.CurrentCamera.CFrame = folder.CameraPart4.CFrame * CFrame.Angles(
math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -maxTilt),
math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -maxTilt),
0
)
elseif WhichCamera == 5 then
workspace.CurrentCamera.CFrame = folder.CameraPart5.CFrame * CFrame.Angles(
math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -maxTilt),
math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -maxTilt),
0
)
end
--mobile users support
elseif game:GetService("UserInputService").TouchEnabled then end
end
end)
-- the play button thingy that is really crucial
play.Frame.Button.Activated:Connect(function()
--[[if workspace:FindFirstChildOfClass("SpawnLocation") then
character.HumanoidRootPart.CFrame = workspace:FindFirstChildOfClass("SpawnLocation").CFrame * CFrame.new(0, 2, 0)
else
character.HumanoidRootPart.CFrame = CFrame.new(0, 2, 0)
end]]
if rs.Booleans.Intermission.Value == false then
script.Parent.Loading.Visible = true
TweenService:Create(currentCamera, TweenInfo.new(.8, Enum.EasingStyle.Back), {FieldOfView = 40}):Play()
TweenService:Create(loadingframe, TweenInfo.new(.3), {Size = UDim2.new(1,0, 1,0)}):Play()
--[[TweenService:Create(loadingframe, TweenInfo.new(.3), {Size = UDim2.new(1,0, 1,0)}):Play()
TweenService:Create(currentCamera, TweenInfo.new(.8, Enum.EasingStyle.Back), {FieldOfView = 40}):Play()]]
for i = 1, 12 do
local cmd = script.TextLabel:Clone()
cmd.Parent = loadingframe.Frame
cmd.Name = "cmd"
if i == 1 then
cmd.Text = "> loading system..."
task.wait(.1)
cmd.Text = "> loading system.."
task.wait(.1)
cmd.Text = "> loading system."
task.wait(.1)
cmd.Text = "> loading system"
task.wait(.1)
cmd.Text = "> loading system."
task.wait(.1)
cmd.Text = "> loading system.."
task.wait(.1)
cmd.Text = "> loading system..."
task.wait(.1)
cmd.Text = "> loading system/execute/Succces%20Initialized"
elseif i == 2 then
cmd.Text = "> " ..player.Name.." joining the battle"
elseif i == 3 then
cmd.Text = "> getting player data... 0/"..#player:GetChildren()
for v = 1, #player:GetChildren() do
cmd.Text = "> getting player data... "..v.."/"..#player:GetChildren()
task.wait(.01)
end
elseif i == 4 then
cmd.Text = "> loading assets... 0/"..#workspace:GetChildren()
for v = 1, #workspace:GetChildren() do
cmd.Text = "> loading assets... "..v.."/"..#workspace:GetChildren()
task.wait(.01)
end
elseif i == 5 then
cmd.Text = "> importing files 0/"..#game.ReplicatedStorage:GetChildren()
for v = 1, #game.ReplicatedStorage:GetChildren() do
cmd.Text = "> importing files... "..v.."/"..#game.ReplicatedStorage:GetChildren()
task.wait(.01)
end
elseif i == 6 then
cmd.Text = "> running system.exe."
task.wait(.1)
cmd.Text = "> running system.exe.."
task.wait(.1)
cmd.Text = "> running system.exe..."
elseif i == 7 then
cmd.Text = "> booting up the game."
task.wait(.05)
cmd.Text = "> booting up the game.."
task.wait(.05)
cmd.Text = "> booting up the game..."
elseif i == 8 then
cmd.Text = ""
elseif i == 9 then
cmd.Text = "> Retrox:\some_bad_guy>Join Success!"
elseif i == 10 then
cmd.Text = "> 01010011 01101111 00101100 00100000 01110101 01110011 01101001 01101110 01100111\n 00100000 01110100 01110010 01100001 01101110 01110011 01101100 01100001 01110100 01101111 01110010 00100000 01100001 01101100 01110010 01100101 01100001 01100100 01111001 00111111 00100000 01010111 01100101 01101100 01101100 00101100 00100000 01111001 01101111 01110101 00100111 01110010 01100101 00100000 01100111 01101111 01101110 01101110 01100001 00100000 01100100 01101111 00100000 01101001 01110100 00100000 01100001 00100000 01101100 01101111 01110100"
elseif i == 11 then
cmd.Text = "> 01010010 01101111 01100010 01101100 01101111 01111000 01000011 01100001 01110100 11100010 10000001 10111011 11000010 10111001 00100000 01101001 01110011 00100000 01110010 01100101 01100001 01101100"
elseif i == 12 then
cmd.Text = "> entering the battle"
end
task.wait(.1)
end
loadingframe.Frame.Visible = false
for i, obj in pairs(loadingframe.Frame:GetChildren()) do
if obj.Name == "cmd" then
obj:Destroy()
end
end
task.wait(1)
currentCamera.FieldOfView = 30
TweenService:Create(currentCamera, TweenInfo.new(.8, Enum.EasingStyle.Back), {FieldOfView = 70}):Play()
TweenService:Create(loadingframe, TweenInfo.new(.3), {Size = UDim2.new(0,0, 0,0)}):Play()
inMenu = false
currentCamera.CameraType = Enum.CameraType.Custom
--firing the event to make player appear in battle
rs.RemoteEvents.PlayPressed:FireServer(player)
script.Parent.Parent.CustomHotBarGui.Enabled = true
task.wait(1)
TweenService:Create(currentCamera, TweenInfo.new(.8, Enum.EasingStyle.Back), {FieldOfView = 70}):Play()
TweenService:Create(loadingframe, TweenInfo.new(.3), {Size = UDim2.new(0,0, 0,0)}):Play()
------------disabling these GUI's------------------------------------
UpdateUI(false)
else
print('No ongoing match!')
end
end)
--=====================Hold On Death===========================
player.CharacterAdded:Connect(function()
folder:WaitForChild("CameraPart")
inMenu = true
loadingframe.Frame.Visible = true
SetMenuCamera()
UpdateUI(true)
end)
--=============================================================
--===================Round End Handle==========================
--=============================================================
rs.RoundEnded.OnClientEvent:Connect(function()
TweenService:Create(currentCamera, TweenInfo.new(.8, Enum.EasingStyle.Back), {FieldOfView = 70}):Play()
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(1,0, 1,0)}):Play()
task.wait(0.5)
local char = workspace:WaitForChild(player.Name).Humanoid
print(char, player)
char:UnequipTools()
script.Parent.Parent.CustomHotBarGui.Enabled = false
inMenu = true
UpdateUI(true)
SetMenuCamera()
if player.Backpack:GetChildren() then
for i, e in pairs(player.Backpack:GetChildren()) do
e:Destroy()
end
end
task.wait(0.5)
TweenService:Create(currentCamera, TweenInfo.new(.8, Enum.EasingStyle.Back), {FieldOfView = 70}):Play()
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(0,0, 0,0)}):Play()
print(player.Backpack:GetChildren())
end)
--=============================================================
--=====================Weapon assign===========================
--=============================================================
--weapon containers
local primary-- = script.Parent.Parent.Primary.Value
local secondary-- = script.Parent.Parent.Secondary.Value
local melee-- = script.Parent.Parent.Melee.Value
--Getting variables' value
rs.WeaponGivingHandlers.GivePrimary.OnClientEvent:Connect(function(gun)
primary = gun
--warn("saved data into 'primary' and player as:", gun, player)
end)
rs.WeaponGivingHandlers.GiveSecondary.OnClientEvent:Connect(function(gun)
secondary = gun
--warn("saved data into 'secondary' and player as:", gun, player)
end)
rs.WeaponGivingHandlers.GiveMelee.OnClientEvent:Connect(function(gun)
melee = gun
--warn("saved data into 'melee' and player as:", gun, player)
end)
local Actionfolder = rs.WeaponGivingHandlers.ToServer
local toserverprimary = Actionfolder.ToServerPrimary
local toserversecondary = Actionfolder.ToServerSecondary
local toservermelee = Actionfolder.ToServerMelee
script.Parent.Play.Frame.Button.MouseButton1Click:Connect(function()
if rs.Booleans.Intermission.Value == false then
--warn("clicked")
warn('weapons', primary, secondary, melee)
if primary then
--warn("equipping primary", primary)
--local gunClone = primary:Clone()
toserverprimary:FireServer(primary)
--gunClone.Parent = player.Backpack
end
if secondary then
--warn("equipping secondary", secondary)
--local gunClone = secondary:Clone()
toserversecondary:FireServer(secondary)
--gunClone.Parent = player.Backpack
end
if melee then
--warn("equipping melee", melee)
--local gunClone = melee:Clone()
toservermelee:FireServer(melee)
--gunClone.Parent = player.Backpack
end
else
print('did not run')
end
end)
--================================================================================================================================================================================
--buttons and back button functions===============================================================================================================================================
--================================================================================================================================================================================
--all the backs================================
back2.Frame.Button.Activated:Connect(function()
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(1,0, 1,0)}):Play()
task.wait(1)
WhichCamera = 1
currentCamera.CFrame = folder.CameraPart.CFrame
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(0,0, 0,0)}):Play()
end)
back3.Frame.Button.Activated:Connect(function()
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(1,0, 1,0)}):Play()
task.wait(1)
WhichCamera = 1
currentCamera.CFrame = folder.CameraPart.CFrame
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(0,0, 0,0)}):Play()
end)
back4.Frame.Button.Activated:Connect(function()
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(1,0, 1,0)}):Play()
task.wait(1)
WhichCamera = 1
currentCamera.CFrame = folder.CameraPart.CFrame
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(0,0, 0,0)}):Play()
end)
back5.Frame.Button.Activated:Connect(function()
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(1,0, 1,0)}):Play()
task.wait(1)
WhichCamera = 1
currentCamera.CFrame = folder.CameraPart.CFrame
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(0,0, 0,0)}):Play()
end)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
shop.Frame.Button.Activated:Connect(function()
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(1,0, 1,0)}):Play()
task.wait(1)
WhichCamera = 4
currentCamera.CFrame = folder.CameraPart4.CFrame
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(0,0, 0,0)}):Play()
end)
loadout.Frame.Button.Activated:Connect(function()
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(1,0, 1,0)}):Play()
task.wait(1)
WhichCamera = 5
currentCamera.CFrame = folder.CameraPart5.CFrame
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(0,0, 0,0)}):Play()
end)
setting.Frame.Button.Activated:Connect(function()
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(1,0, 1,0)}):Play()
task.wait(1)
WhichCamera = 2
currentCamera.CFrame = folder.CameraPart2.CFrame
--warn("pressed", setting, currentCamera)
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(0,0, 0,0)}):Play()
end)
credits.Frame.Button.Activated:Connect(function()
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(1,0, 1,0)}):Play()
task.wait(1)
WhichCamera = 3
currentCamera.CFrame = folder.CameraPart3.CFrame
--warn("pressed", credits, currentCamera)
TweenService:Create(Black, TweenInfo.new(.3), {Size = UDim2.new(0,0, 0,0)}):Play()
end)
--================================================================================================================================================================================
--Mouse enter things===========--=================================================================================================================================================
--================================================================================================================================================================================
setting.Frame.Button.MouseEnter:Connect(function()
TweenService:Create(setting.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.95,0,0.95,0)}):Play()
end)
setting.Frame.Button.MouseLeave:Connect(function()
TweenService:Create(setting.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0,0,0.95,0)}):Play()
end)
play.Frame.Button.MouseEnter:Connect(function()
TweenService:Create(play.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.95,0,0.95,0)}):Play()
end)
play.Frame.Button.MouseLeave:Connect(function()
TweenService:Create(play.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0,0,0.95,0)}):Play()
end)
credits.Frame.Button.MouseEnter:Connect(function()
TweenService:Create(credits.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.95,0,0.95,0)}):Play()
end)
credits.Frame.Button.MouseLeave:Connect(function()
TweenService:Create(credits.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0,0,0.95,0)}):Play()
end)
back2.Frame.Button.MouseEnter:Connect(function()
TweenService:Create(back2.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.95,0,0.95,0)}):Play()
end)
back2.Frame.Button.MouseLeave:Connect(function()
TweenService:Create(back2.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0,0,0.95,0)}):Play()
end)
back3.Frame.Button.MouseEnter:Connect(function()
TweenService:Create(back3.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.95,0,0.95,0)}):Play()
end)
back3.Frame.Button.MouseLeave:Connect(function()
TweenService:Create(back3.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0,0,0.95,0)}):Play()
end)
back4.Frame.Button.MouseEnter:Connect(function()
TweenService:Create(back4.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.95,0,0.95,0)}):Play()
end)
back4.Frame.Button.MouseLeave:Connect(function()
TweenService:Create(back4.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0,0,0.95,0)}):Play()
end)
back5.Frame.Button.MouseEnter:Connect(function()
TweenService:Create(back5.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.95,0,0.95,0)}):Play()
end)
back5.Frame.Button.MouseLeave:Connect(function()
TweenService:Create(back5.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0,0,0.95,0)}):Play()
end)
loadout.Frame.Button.MouseEnter:Connect(function()
TweenService:Create(loadout.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.95,0,0.95,0)}):Play()
end)
loadout.Frame.Button.MouseLeave:Connect(function()
TweenService:Create(loadout.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0,0,0.95,0)}):Play()
end)
shop.Frame.Button.MouseEnter:Connect(function()
TweenService:Create(shop.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.95,0,0.95,0)}):Play()
end)
shop.Frame.Button.MouseLeave:Connect(function()
TweenService:Create(shop.White, TweenInfo.new(.8, Enum.EasingStyle.Exponential), {Size = UDim2.new(0,0,0.95,0)}):Play()
end)
--==========================
--================================================================================================================================================================================
--=========================Shop functionality=====================================================================================================================================
--================================================================================================================================================================================
local MarketplaceService = game:GetService("MarketplaceService")
local layout = script.PassFrame
local PassesFrame = script.Parent.Frames.ShopFrame.Frame.ButtonsSector.ScrollingFrame
local ids = {
169225577,
1002950368,
1004204303
}
for i, id in pairs(ids) do
local success, productInfo = pcall(function()
return MarketplaceService:GetProductInfo(id, Enum.InfoType.GamePass)
end)
if success and productInfo then
if productInfo.IsForSale then
local button = layout:Clone()
button.Name = productInfo.Name
button.Parent = PassesFrame
button.F.PassNameLabel.Text = productInfo.Name
button.F.Button.Text = productInfo.PriceInRobux
button.F.Img.Image = "rbxassetid://" .. productInfo.IconImageAssetId
--print("Description: " .. productInfo.Description)
--warn("Created gamepass with such things:", id, productInfo.IconImageAssetId, productInfo.PriceInRobux, productInfo.Name, button.Parent)
button.F.Button.MouseButton1Click:Connect(function()
MarketplaceService:PromptPurchase(player, id)
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, doubleIDcheck, purchaseSuccess)
if purchaseSuccess and doubleIDcheck == id then
print(player.Name .. " purchased the Pass with ID " .. id)
game.ReplicatedStorage.DiedRE:FireServer()
else
print("bad guy", player, "didn't buy anything >:(")
end
end)
end)
else
print("This product isn't for sale", id)
end
end
end