Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED]Gui wont open after player dies?

Asked by
soutpansa 120
5 years ago
Edited 5 years ago

After the player dies, they can't open this gui anymore. It's really annoying

wait(4)
local Player = game.Players.LocalPlayer
local NonStats = Player.NonStats
local GroupRankValue = NonStats.GroupRankValue
local mouse = Player:GetMouse()

GroupRankValue.Value = Player:GetRoleInGroup(4375377)
wait(0.5)
mouse.KeyDown:Connect(function(key)
    local Key = key:lower()
    if  Player.NonStats.Admin.Value == 1987293 then
    if key == "p" then
        if Player.PlayerGui.MainHud.ControlPanel.Visible == false then
             Player.PlayerGui.MainHud.ControlPanel.Visible = true
        elseif Player.PlayerGui.MainHud.ControlPanel.Visible == true then
             Player.PlayerGui.MainHud.ControlPanel.Visible = false
            end
        end
    end
end)
0
I fixed it by using a button instead of KeyDown soutpansa 120 — 5y

Answer this question