Unanchoring a brick via script

Currently I have a script that is intended to, when a player says “start”, the script makes the anchored value for the part false. It is, by default, anchored. The script is below. It throws up a Syntax error as well:

“Expected ‘end’ (to close function at line 1), got ; did you forget to close ‘then’ at line 3?”

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(msg)
		if msg == "Start" then
			game.Workspace.Ball1.Anchored = false
		end
end)
game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(msg)
		if msg == "Start" then
			game.Workspace.Ball1.Anchored = false
		end
    end)
end)

Missing end to close inside function

Oh, was very confused, thought it meant an end in line 1 but thought that’d make no sense… Thank you :slight_smile:

1 Like