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

Expected ')' (to close '(' at column 65), got ','? I dont get it!

So I am trying to make a positioning script and the positioning wont even work. I keep on getting this error that I don't understand it say it expects ')' but I don't know where to put it. I get this error on line 18 but it says at column 65, I dont know what that is. Btw Im trying to position a model on a player

here is my script

local Lighting = game.Lighting
local Vest = Lighting:WaitForChild("Flak Jacket")


game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("UpperTorso")

        local ClonedVest = Vest:Clone()
        ClonedVest.Parent = character

        ClonedVest:SetPrimaryPartCFrame(character:WaitForChild("UpperTorso"))

        local Weld = Instance.new("Weld")
        Weld.Part0 = ClonedVest.Main
        Weld.Part1 = character:WaitForChild("UpperTorso")
        Weld.Parent = character:WaitForChild("UpperTorso")
        Vest:SetPrimaryPartCFrame(Vest:GetPrimaryPartCFrame() * (0,0,5))
    end)
end)

2 answers

✓ Accepted answer

On line 18, you are multiplying a CFrame by (0,0,5). But what is (0,0,5)? If you are trying to make a new CFrame, you have to use a constructor by either writing CFrame.new(0,0,5) or CFrame.angles(0,0,5) depending on what you want. Otherwise, Roblox does not know what you are trying to do, and assumes you were just using parentheses for a math operation, so it does not expect the comma.

4 comments

0

I did just that and nothing happened

0

That is because you are changing the Vest when you should be changing the ClonedVest.

0

the output says "Unable to cast Instance to CoordinateFrame"

0

Which line is the error occuring?

local Lighting = game.Lighting local Vest = Lighting:WaitForChild("Flak Jacket")

game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("UpperTorso")

    local ClonedVest = Vest:Clone()
    ClonedVest.Parent = character

    ClonedVest:SetPrimaryPartCFrame(character:WaitForChild("UpperTorso"))

    local Weld = Instance.new("Weld")
    Weld.Part0 = ClonedVest.Main
    Weld.Part1 = character:WaitForChild("UpperTorso")
    Weld.Parent = character:WaitForChild("UpperTorso")
    Vest:SetPrimaryPartCFrame(Vest:GetPrimaryPartCFrame() * CFrame.new(0,0,5))
end)

end)

1 comment

0

i get an error that says 'Unable to cast Instance to CoordinateFrame'

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