While I was coding this thing I got an error from the output. “Expected ‘)’ (to close ‘(’ at line 3), got ‘end’”
This is the code:
local remote = game.ReplicatedStorage:WaitForChild("AddToPlayer")
local tool = game.ReplicatedStorage:WaitForChild("Tool")
remote.OnServerEvent:Connect(function(player, part)
local char = player.Character or player.CharacterAdded:Wait()
local newtool = tool:Clone()
local newpart = part:Clone().Parent == game.ServerStorage
part.Name = "Handle"
part.Parent = newtool
newtool.Name = newpart.Name
newtool.Parent = char
wait(0.01)
newpart:Destroy()
end
end) --problematic line
How can I fix this so my code can work? No errors occurred in the localscript that fires the event.