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

Why isn't the GUI showing up when I sit down?

Asked by 8 years ago

So I have this script that some people help me with. (Thank you to all who did. :D) The script that I made is not working.

script.Parent.Changed:connect(function(property)
    local occupant = script.Parent.Occupant

    if occupant then
        local character = occupant.Parent
        local player = game.Players:GetPlayerFromCharacter(character)
        if player then
            local gui = player.PlayerGui["Catalog GUI"]
            gui.MainHolder.Visible = true
        end
    end
end)

1 answer

Log in to vote
0
Answered by 8 years ago

See if this will work.

local seat = script.Parent

local ownervalue = seat.OwnerValue

seat.ChildAdded:connect(function(child)
    if child:IsA("Weld") and child.Name == "SeatWeld" then
        local character = child.Part1.Parent
        local player = game.Players:GetPlayerFromCharacter(character)
        if player then
            local gui = player.PlayerGui["Catalog GUI"]
            gui.MainHolder.Visible = true
        end
    end
end)
0
Anyway to make it so that when they get off the seat, it closes? BennyBoiOriginal 293 — 8y
Ad

Answer this question