Attempt to index nil with PlayerGU Error

Hey, I’m trying to put a tween when you press the no button, causing the frame to go down, and turn invisible - however I’m getting this error and I’m not sure why.

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function(player)

	player.PlayerGui.StartEvent.Frame:TweenPosition(
		UDim2.new(0.28, 0,1, 0),
		"Out",
		"Bounce",
		1,
		true
	) 


	script.Parent.Parent.Parent.Parent.StartEvent.Enabled = false
	game.Workspace.c9.Script.Disabled = false
end)

image

Any help is really appreciated

Can you try this,

script.Parent.Parent:TweenPosition(
		UDim2.new(0.28, 0,1, 0),
		"Out",
		"Bounce",
		1,
		true
	) 

instead of this.

Hey, it doesn’t seem to be working - it just closes without the tween and the script doesn’t get undisabled