local SideBar = script.Parent.SideBar
local Camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
local function hover(button)
button.MouseEnter:Connect(function()
button.TextColor3 = Color3.fromRGB(144, 144, 144)
end)
button.MouseLeave:Connect(function()
button.TextColor3 = Color3.fromRGB(255, 255, 255)
end)
end
local function loadWeapons(plr)
game.ReplicatedStorage.RemoteEvents.Gun.GiveStarterPistol:FireServer()
end
hover(SideBar.Play)
hover(SideBar.Settings)
SideBar.Play.MouseButton1Click:Connect(function()
SideBar.Visible = false
loadWeapons(player)
player.PlayerGui.Main.Backpack.Enabled = true
script.Parent.About.Visible = false
Camera.CameraType = "Custom"
end)
SideBar.Settings.MouseButton1Click:Connect(function()
script.Parent.About.Visible = not script.Parent.About.Visible
end)
If the local script is the problem, how do I disable after it has run?
Reset on spawn just means if you want to GUI to redo all of it’s contents, kind of like refreshing the page, while disabling means that it will stay put when the player dies.
It doesn’t! That’s the point of setting it to false, so the GUI STAYS THERE even when the player dies.
No this is what I mean, (could you reply instead of edit)
The loading screen appears, you press play, it disables. Then you die it wouldn’t reset (enable)
Unless I don’t get anything lol.
Also I do I stop a local script from running again?
Wasn’t talking about that, should have mentioned. I was talking about the play screen. The guns I am using use a shoulder camera and it locks your mouse.
One method is to clone the gui into the player’s playergui on the server side with PlayerAdded. that way when they die, they dont get the gui again because they aren’t rejoining the server, only getting a new character.