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

How could I end this event?

I was wondering how I could end this event because I keep an error.

Players.Player1.Backpack.Tool.LocalScript:21: unexpected symbol near ')'

---------------Vairbles---------------
local Tool = script.Parent
local Handle = script.Parent.Handle
local Player = game.Players.LocalPlayer--Gets LocalPlayer(which is the player with tool or script)
local PlayersMouse = Player:GetMouse()--Gets the Players mouse with the GetMouse() method
local Clicked = false
----------------EquipedEvent-------------
    Tool.Equipped:connect(function(Mouse)
        ---------------------Button1Down---------------------------------
        Mouse.Button1Down:connect(function()--When the player press the right button(Button1) it will do the thing below
            Mouse.Icon  = "http://www.roblox.com/asset/?id=13890082"--Changes the crusor Icon to a plus sign
		Handle.BrickColor = BrickColor.new("Bright green")
				Clicked = true
				if not Clicked
					then
					local Part = Instance.new("Part",game.Workspace)
						Mouse.Move:connect(function()
							Part.CFrame = CFrame.new(Mouse.Origin.p)	
							end)
			
			end)
			end           
            --------------------Button1Up---------------------------------
            Mouse.Button1Up:connect(function()--When the player releases the right button(Button1) it will do the thing below
--            	local Part = Instance.new("Part",game.workspace)
--						  Part.Anchored = true
--                          Part.CFrame = CFrame.new(Mouse.Hit.p)    
                Mouse.Icon = ""--Changes the crusor icon back to normal
                Handle.BrickColor = BrickColor.new ("Bright red")
                ------------------------------------------------------------
            end)
    end)


1 answer

✓ Accepted answer

Your problem was that you needed to move the end) down one line.

Example :

end
end)

Below is your code but with the fix.

---------------Vairbles---------------
local Tool = script.Parent
local Handle = script.Parent.Handle
local Player = game.Players.LocalPlayer--Gets LocalPlayer(which is the player with tool or script)
local PlayersMouse = Player:GetMouse()--Gets the Players mouse with the GetMouse() method
local Clicked = false
----------------EquipedEvent-------------
Tool.Equipped:connect(function(Mouse)
	---------------------Button1Down---------------------------------
	Mouse.Button1Down:connect(function()--When the player press the right button(Button1) it will do the thing below
		Mouse.Icon  = "http://www.roblox.com/asset/?id=13890082"--Changes the crusor Icon to a plus sign
		Handle.BrickColor = BrickColor.new("Bright green")
		Clicked = true
		if not Clicked then
			local Part = Instance.new("Part",game.Workspace)
			Mouse.Move:connect(function()
				Part.CFrame = CFrame.new(Mouse.Origin.p)	
			end)
		end
	end)	   
	--------------------Button1Up---------------------------------
	Mouse.Button1Up:connect(function()--When the player releases the right button(Button1) it will do the thing below
--			  local Part = Instance.new("Part",game.workspace)
--						Part.Anchored = true
--						  Part.CFrame = CFrame.new(Mouse.Hit.p)	
				Mouse.Icon = ""--Changes the crusor icon back to normal
				Handle.BrickColor = BrickColor.new ("Bright red")
				------------------------------------------------------------
			end)
	end)

If you have any questions, concerns or just need some help with this PM me on ROBLOX!

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