Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i disable a certain gui on touch?

So basically i need a script where once you are touching a part it DISABLES a CERTAIN GUI in STARTERGUI and once you are not touching it, its back to normal (enabled)

Can someone help

1 answer

I haven't tested this but it should work

script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
player.PlayerGui.GUINAMEHERE.Enabled = false
end
end)

script.Parent.TouchedEnded:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
player.PlayerGui.GUINAMEHERE.Enabled = true
end
end)

put this script inside the part

This discussion is preserved as it was. New answers, comments, and votes are closed.