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)
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.
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)