I have a part in workspace and this script is in the part. When I touch the part, I want the gui to pop up (Become visible)
partTouched = script.Parent.Touched:connect() script.Parent.Touched:connect(function() if partTouched then game.StarterGui.ArrowGui.Frame.Visible = true end end)
script.Parent.Touched:connect(function(hit) print("Step 1") print(hit.Name) if hit.Parent:findFirstChild("Humanoid") ~= nil then print("Step 2") player = game.Players:findFirstChild(hit.Parent.Name) player.PlayerGui.ArrowGui.Frame.Visible = true print("Step 3") end end)
you have the partTouched all messed up, try using the values that come with the function like so:
partTouched = script.Parent.Touched -- this is a function, not a value partTouched:connect(function(hit) -- to be used like this, where "hit" is the part that it was touched by if hit ~= nil then -- if you hit something game.StarterGui.ArrowGui.Frame.Visible = true -- do your stuff end end)