Please tweak my script
This script is supposed to make a frame visible when you touch it, and when you stop touching it,
the frame goes away. It does nothing, why?
note: this script is in a part, and the frame is in StarterGui > ScreenGui > [the Frame I'm talking about]
LocalScript:
part.Touched:connect(function() touched = true while true do StarterGui.ScreenGui.Frame.Visible = true end)
This script is probably very confusing since its made by me
The real reason is the gui of the player is in player.PlayerGui so this would be the corrected version of the script
part.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then -- [[Checking to make sure who touched was a player]] touched = true game.Players:GetPlayerFromCharacter(hit.Parent).PlayerGui.Frame.Visible = true end end)
Im sure your suppose to use the mouse button event and do you mean when its touched or hit?
You should make the frame visible from the playerGui, you can find that folder inside the player. I think it's better to do that from the client. Also you should use the event TouchEnded for when the player stops touching the part.