How exactly can I implement this into my code? I am not very good at scripting and this is sort of a learning project for me.
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local CloseButton = script.Parent.LoadoutClose
local LOButton = script.Parent.Main.LoadoutButton
local ClickSound = script.Parent.Click
local HoverSound = script.Parent.Hover
local ShopSound = script.Parent.Shop
LOButton.MouseEnter:Connect(function()
HoverSound:Play()
end)
LOButton.MouseButton1Click:Connect(function()
ClickSound:Play()
CloseButton.Visible = true
script.Parent.Main.Visible = false
ShopSound:Play()
script.Parent.LeftArrow.Visible = true
script.Parent.RightArrow.Visible = true
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.CamPart1.CFrame
end)
CloseButton.MouseEnter:Connect(function()
HoverSound:Play()
end)
CloseButton.MouseButton1Click:Connect(function()
Camera.CameraType = Enum.CameraType.Custom
CloseButton.Visible = false
ShopSound:Stop()
ClickSound:Play()
script.Parent.LeftArrow.Visible = false
script.Parent.RightArrow.Visible = false
script.Parent.Main.Visible = true
end)
script.Parent.Main.PlayButton.MouseEnter:Connect(function()
HoverSound:Play()
end)
script.Parent.Main.PlayButton.MouseButton1Click:Connect(function()
script.Parent.Main.Visible = false
ClickSound:Play()
end)
script.Parent.LeftArrow.MouseEnter:Connect(function()
HoverSound:Play()
end)
script.Parent.LeftArrow.MouseButton1Click:Connect(function()
ClickSound:Play()
end)
script.Parent.RightArrow.MouseEnter:Connect(function()
HoverSound:Play()
end)
script.Parent.RightArrow.MouseButton1Click:Connect(function()
ClickSound:Play()
end)
This is the full GuiHandler local script. Unfortunately, the preformatted text doesn’t seem to like me.
I am going to include a snippet of the explorer tab as well.
basically, all of the GUI’s work is under the GuiHandler right now (script above). I have word for word copy and pasted your script into a new script to potentially have a more organized system. Obviously, copy and pasting a script into my system isn’t gonna work most likely, just needs a little bit of fixing up to be able to work together.
Also, I removed all of the code that had to do with lerping but I still have the player’s camera change to camera 1’s CFrame and they are able to exit with the closing button.
My question: How can I get this to work with my current script?