#how would i make a gui appear when i stand on a part then disappear when i leave the part

2 messages · Page 1 of 1 (latest)

charred girder
#
local Players = game:GetService("Players")
local Player = Players.LocalPlayer

-- define Part

local GuiShown = false

Part.Touched:Connect(function(HitPart)
    local Character = Player.Character
    if not Character then return end
    if not HitPart:IsDescendantOf(Character) then return end
    if GuiShown then return end
    -- show the gui
    GuiShown = true
end)

Part.TouchEnded:Connect(function(HitPart)
    local Character = Player.Character
    if not Character then return end
    if not HitPart:IsDescendantOf(Character) then return end
    if not GuiShown then return end
    -- hide the gui
    GuiShown = false
end)

This code is for localscript
Replace comments with your actual gui show/hide logic

#

I'm not sure this will work