GlitxchSZ
(GlitchDev)
June 11, 2021, 9:25pm
#1
I’m making a very very simple main menu though, it doesn’t appear to do anything when I click the button that should do the requested things. I’ve tried re-arraging the code and editing it but nothing seems to be working. Please help!
This is what happens when I try playtest the game:
Heres the script:
ps. I’m very… VERY new to scripting so if the code is severely incorrect, you know why
The local script is located in StarterGui with a parent that is a ScreenGui named “InsertedObjects”
1 Like
Kaid3n22
(Kaiden)
June 11, 2021, 9:33pm
#2
this is because you are trying to check when a startergui button is clicked. You need to find the button in the playergui, not the startergui.
local plr = game.Players.LocalPlayer
local button = plr.PlayerGui.InsertedObjects.Button ---like this
1 Like
GlitxchSZ
(GlitchDev)
June 11, 2021, 9:34pm
#3
Okay, let me try moving it then
Kaid3n22
(Kaiden)
June 11, 2021, 9:34pm
#4
it’s not really about moving anything as you are just trying to find it in the wrong place.
GlitxchSZ
(GlitchDev)
June 11, 2021, 9:35pm
#5
Well, I meant move the button to the right place
Kaid3n22
(Kaiden)
June 11, 2021, 9:35pm
#6
if the button is inside of StarterGui, it automatically clones to people’s PlayerGui. You just need to check the playergui to find what is showing on the player’s screen.
GlitxchSZ
(GlitchDev)
June 11, 2021, 9:37pm
#7
Sorry, I don’t understand. Can you explain it in another way if possible?
Kaid3n22
(Kaiden)
June 11, 2021, 9:38pm
#8
Ok, when a player joins, everything that is in StarterGui then replicates into their PlayerGui. If you want to edit what they are seeing, you have to go through their PlayerGui.
GlitxchSZ
(GlitchDev)
June 11, 2021, 9:39pm
#9
Oh, I see now. Let me try
ignore this this is just the 30 letter thing
GlitxchSZ
(GlitchDev)
June 11, 2021, 9:44pm
#10
Still isn’t working, did I do something wrong?
local plr = game.Players.LocalPlayer
local button = plr.PlayerGui.InsertedObjects.Button
local Notice = game.PlayerGui.InsertedObjects.Notice
local blur = game.Lighting.Blur
game.Players.LocalPlayer.Character:WaitForChild(“Humanoid”).WalkSpeed = 0
game.Players.LocalPlayer.CameraMaxZoomDistance = 50
game.Players.LocalPlayer.CameraMinZoomDistance = 50
print (“Main Menu Camera Has Started Running”)
local cam = workspace.CurrentCamera
local CameraLock = game.Workspace.CameraLock
wait (0.1)
cam.Focus = CameraLock.CFrame
cam.CameraType = “Fixed”
game.StarterGui.InsertedObjects.MouseButton1Click:Connect(function()
Notice.Visible = false
button.Visible = false
wait (0.2)
blur.Size = 12
wait (0.2)
blur.Size = 9
wait (0.2)
blur.Size = 7
wait (0.2)
blur.Size = 5
game.Players.LocalPlayer.Character:WaitForChild(“Humanoid”).WalkSpeed = 16
game.Players.LocalPlayer.CameraMaxZoomDistance = 200
game.Players.LocalPlayer.CameraMinZoomDistance = 0.5
cam.CameraType = “Custom”
cam.CameraSubject = workspace.player.Character.Humanoid
end)
Kaid3n22
(Kaiden)
June 11, 2021, 9:45pm
#11
should be
local Notice = plr.PlayerGui.InsertedObjects.Notice
should be
plr.PlayerGui.InsertedObjects.MouseButton1Click:Connect(function()
that’s all the mess ups I see rn
1 Like
GlitxchSZ
(GlitchDev)
June 11, 2021, 11:09pm
#12
Aight, fixed those. I’m gonna try and find some more errors