So I'm getting this error, 19:48:19.203 - Players.MrMeeper9.Backpack.LocalScript:36: Expected ')' (to close '(' at line 16), got <eof>, how to fix?
repeat wait() until game.Players.LocalPlayer.Character local Plr = game.Players.LocalPlayer local Char = Plr.Character or Plr.CharacterAdded:Wait() local Mouse = Plr:GetMouse() local CouldGetLeaves = true function ShowProgress(Leaves) if CouldGetLeaves == "Leaves" then for i = 0,1,.01 do WC.BG.Bar.Progress.Size = UDim2.new(i,0,1,0) wait() end end end Mouse.Button1Down:connect(function() if Mouse.Target ~= nil and Mouse.Target.Parent.Name == "Leaves" and CouldGetLeaves == true then local Wood = Mouse.Target if (Wood.Position - Char.UpperTorso.Position).magnitude < 10 then CouldGetLeaves = false WC = Plr.PlayerGui.WoodChopper WC.BG.Visible = true Char.Humanoid.WalkSpeed = 0 ShowProgress ("Leaves") Char.Humanoid.WalkSpeed = 16 for i,v in pairs(Wood.Parent.Leaves:GetChildren())do if v:IsA("Leaves") then v.Anchored = false end end end Wood:Destroy() WC.BG.Visible = false CouldGetLeaves = true end end
The exception that was raised was an EOF
or End of File. It is usually cause by an open parenthesis missing it's partner, and the compiler reached the end of the Script trying to look for it. This of which is your case; your Connect
method's argumental parentheses weren't closed, therefore your code is reading:
Mouse.Button1Down:Connect(
To solve this issue, make sure to enclose the parentheses next time.
local Player = game:GetService("Players").LocalPlayer local Mouse = Player:GetMouse() local Character = Player.Character or Player.CharacterAdded:Wait() local Humanoid = Character:WaitForChild("Humanoid") local PlayerGui = Player:WaitForChild("PlayerGui") local WoodChopper = PlayerGui:WaitForChild("WoodChopper") local ChopperBackground = WoodChopper:WaitForChild("BG") local ChopperBar = ChopperBackground:WaitForChild("Bar") local ChopProgress = ChopperBar:WaitForChild("Progress") local CanGetLeaves = true local function ShowProgress(Leaves) if (Leaves == "Leaves") then local Direction = Enum.EasingDirection.Out local Style = Enum.EasingStyle.Linear ChopProgress:TweenSize(UDim2.new(1,0,1,0), Direction, Style, 1, true) end end Mouse.Button1Down:Connect(function() local Wood = Mouse.Target if (Wood and Wood.Parent.Name == "Leaves" and CanGetLeaves) then if (Player:DistanceFromCharacter(Wood.Position) < 10) then ChopperBackground.Visible = true Humanoid.WalkSpeed = 0 ShowProgress("Leaves") Humanoid.WalkSpeed = 16 for _,Leaf in pairs(Wood.Parent.Leaves:GetChildren()) do if Leaf:IsA("Leaves") then Leaf.Anchored = false end end end Wood:Destroy() BG.Visible = false CanGetLeaves = true end end)
If that helped, don't forget to accept this answer!