#GUI GIVER PROBLEM :(

1 messages · Page 1 of 1 (latest)

ebon rock
#
local Players = game:GetService("Players")

local GiverGUI = script.Parent
local LocalPlayer = Players.LocalPlayer

local BookingGUI = script.Parent.Parent.PremierInnBooking

local GroupID = 35153508
local PlayerGroupRank = LocalPlayer:GetRankInGroup(GroupID)

local PlayerBookingGUI = LocalPlayer.PlayerGui:FindFirstChild("PremierInnBooking")
local PName = LocalPlayer.Name

function click(Players)
    if PlayerGroupRank >= 14 then
        PlayerBookingGUI.Enabled = true
        print(PName .. "GUI Enabled")
        
    elseif not LocalPlayer.PlayerGui:FindFirstChild("PremierInnBooking") then
        local Gui = script.Parent.Parent.PremierInnBooking:Clone()
        Gui.Parent = LocalPlayer.PlayerGui
        PlayerBookingGUI.Enabled = true
        print(PName .. "GUI Creation")
    end
end

GiverGUI.MouseClick:Connect(click)```

I am trying to make a GUI Giver that will create & give/enable the GUI within the player's GUIs. I have no errors!
little void
#

So I'm confused you say if the gui exists then enable it but if not, clone it?

ebon rock
#

If the GUI is there, enable it