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

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

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
1
Answered by 4 years ago

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.

0
I did just that and nothing happened Fxding_cam 60 — 4y
0
That is because you are changing the Vest when you should be changing the ClonedVest. IStarConquestI 414 — 4y
0
the output says "Unable to cast Instance to CoordinateFrame" Fxding_cam 60 — 4y
0
Which line is the error occuring? IStarConquestI 414 — 4y
Ad
Log in to vote
0
Answered by
iuclds 720 Moderation Voter
4 years ago

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)

0
i get an error that says 'Unable to cast Instance to CoordinateFrame' Fxding_cam 60 — 4y

Answer this question