script.Parent.Activated:connect(function() script.Parent.Handle.Touched:connect(function(hit) local y = hit.Parent:FindFirstChild("Humanoid") if y then if script.Parent.Handle.Touched.Name == "Rock" then game.Players.LocalPlayer.PlayerGui.ScreenGui.TextBox.Visible = true end end end) end)
The Touched event returns a parameter named by you hit
, which is the part that the Handle touched.
In this block, instead of using script.Parent.Handle.Touched
, you should use the hit
:
if hit.Name == "Rock" then game.Players.LocalPlayer.PlayerGui.ScreenGui.TextBox.Visible = true end
As .Touched
is the event itself.