Hello! I'm trying to make GUI appear when I touch block. I did this script below but it doesn't works, also I don't have any errors, any ideas what should I change? (script is in local script)
local Player = game.Players.LocalPlayer
local function change(hit)
if hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
Player.PlayerGui.UniformGui.Frame.Visible=true
end
end
script.Parent.Touched:Connect(change)

3 comments
Line 4 may be the problem, try putting ~= nil as a condition for the two conditions... Also put a print before the if statement and one inside it to see what your script is doing when you touch the block (i.e. is it even detecting if you touch it? Is it working correctly but line 6 is the issue? Etc.)
are you using a local script?
I tried this script with print and it works correct, just something is wrong in line 6