How to open a tween gui by touching a part

My script is not working can someone help me

game.Workspace.hehe.Touched:Connect(function(hit)
	if hit then
		Player.PlayerGui.ScreenGui.Frame:TweenSize(0.742, 0,0.93, 0)
	end
end)	

there is nothing named “Player” here

wdym i dont understand :thinking: :face_with_raised_eyebrow: :thinking:

You’ve not defined the local player.
Player on its own doesn’t mean the player.

Also I’d suggest moving this to #help-and-feedback:scripting-support

1 Like
game.Workspace.hehe.Touched:Connect(function(hit)
	if hit then
-- what is this V
		Player.PlayerGui.ScreenGui.Frame:TweenSize(0.742, 0,0.93, 0)
	end
end)	

Where is Player coming from?? You only have hit!

1 Like

Place a local script in starterPlayerScripts

local player = game:GetService("Players").LocalPlayer
local ui = player.PlayerGui.ScreenGui.Frame


game.Workspace.hehe.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        ui:TweenSize(UDim2.new(0.742, 0,0.93, 0))
    end
end)

i tried to meant what others said.