Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to fix the "Expected ')' to close '(', got '?'" error? *SOLVED*

Asked by 5 years ago
Edited 5 years ago

Im trying to make a script that clones an accessory and puts it in a player uppon joining the server.

But the problem is a error that appears in my script:

Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
 Player.CharacterAdded:Connect(function(Character)
  print("Sword Added")
  local Character = Player.Character or Player.CharacterAdded:Wait()
  local GrandSword = game:GetService("ReplicatedStorage").GrandSword:Clone()
   GrandSword.Parent = Character

  local Weld = Instance.new("Weld")
   Weld.Parent = GrandSword
   Weld.Part0 = GrandSword.Handle
   Weld.Part1 = Character.Torso
   Weld.C0 = CFrame.new(-3.7,0,-.6) * CFrame.Angles(0, math.rad(-44.5), 0)
 end)
end)

The error: ServerScriptService.Script:13: Expected ')' (to close '(' at column 64), got '?'

In my eyes every "(" that has been opened has been closed already so idk, help?

0
Do you need the question mark on line 13? Deleting that gets rid of the error rebot333 40 — 5y
0
Yep thats it, you made an accidental ? firestarroblox123 440 — 5y
0
Ops sorry the question mark isnt actually in the script, i put it in there accidentally kevinsoaresv 47 — 5y
0
Oh. firestarroblox123 440 — 5y
View all comments (2 more)
0
Line 5 is redundant as 3 already provides the Character when loading. M39a9am3R 3210 — 5y
0
Oh yeah, dint even notice that, thank you so much! kevinsoaresv 47 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

Try using script analysis and click the errors, it will show you exactly where it is

Ad
Log in to vote
0
Answered by 5 years ago

The problem was in a wrong character.Looks like there was a character in the line 13 that looked like the character i wanted but it wasnt actually the character i wanted.

0
Oh ok Kriscross102 118 — 5y
0
Oh ok Kriscross102 118 — 5y

Answer this question