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

Script not working. IIt doesn't open the GUI when clicked. How to fix?

Asked by
ghxstlvty 133
4 years ago
local function CheckGroupStats(Player, Rank, Group)
    if Player:GetRankInGroup(Group) >= Rank then
        return true
    else
        return false
    end
end

script.Parent.Click.MouseClick:Connect(function(Player)
    if CheckGroupStats(Player, 255, 4853203) then
        if not Player.PlayerGui:FindFirstChild("EmployeeViewGui") then
            local FindGui = game.Lighting:FindFirstChild("EmployeeViewGui")
            if FindGui then
                local ClonedGui = FindGui:Clone()
                ClonedGui.Parent = Player.PlayerGui
                ClonedGui.Enabled = true

                ClonedGui.Frame.Close.MouseButton1Click:Connect(function()
                    ClonedGui:Destroy()
                end)
            end
        end
    end
end)

This script was transferred from my old game. My game is a Grocery Store.

And yes, there is a click detector ; http://prntscr.com/pom6st

Answer this question