I wanted to make a screen gui that pops-up when player touchs a part and closes after the player stops touching the part and i want it to be clickable but i could only do this
script.Parent.Touched:connect(function(hit) humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid ~= nil then player = game.Players:GetPlayerFromCharacter(hit.Parent) player.PlayerGui.ScreenGui.TextButton.Visible = true wait() end end)
script.Parent.Touched:Connect(function(hit) humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid ~= nil then player = game.Players:GetPlayerFromCharacter(hit.Parent) player.PlayerGui.ScreenGui.Enabled = true wait() end end)
You were making thee TextButton visible rather than enabling the ScreenGui.
script.Parent.Touched:Connect(function(hit) humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid ~= nil then player = game.Players:GetPlayerFromCharacter(hit.Parent) player.PlayerGui.ScreenGui.Enabled = true wait() end end)
All you did was make only the button visible instead of the gui itself