Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Error with a local script in startergui. Problems with ends. Help?

pad1 = workspace["Open me"].Stop
pad = workspace["Open me"].Start
pad.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

		local Playing = plr.Playing

		Playing.Value = true
	end
pad1.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)

		local Playing = plr.Playing

			Playing.Value = false
			wait(3)
			Playing:destroy()
	
	end
end)

Error: Players.xp5u.PlayerScripts.LocalScript:22: Expected 'end' (to close 'function' at line 3), got ; did you forget to close 'then' at line 12? - Studio - LocalScript:22

2 answers

Remove the closing parenthesis on line 22 so it just says "end" not "end)".

2 comments

0

It doesn't exactly work, I got: Players.xp5u.PlayerScripts.LocalScript:22: Expected ')' (to close '(' at line 11), got - Studio - LocalScript:22

0

Oh yeah... Try Hate_ZEU's response below then.

At line 10 you got just an end, you need another end) to close the first touched event.

This discussion is preserved as it was. New answers, comments, and votes are closed.