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

How can I fix this connection error on my welding script for my vest?

I made a vest and I am trying to attach it and weld it to the player's uppertorso but i keep getting this error that says "Flak Jacket:4: Expected '(', '{' or , got ':'".

I thought I wasn't doing anything wrong but that happened, here's my script. Pay Attention to the "playeradded connect" part.

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").CFrame)
		local Weld = Instance.new("Weld")
		Weld.Part0 = ClonedRH.Main
		Weld.Part1 = character:WaitForChild("UpperTorso")
		Weld.Parent = character:WaitForChild("UpperTorso")
	end)
end)

1 answer

✓ Accepted answer

On line 4, You put game.Players:PlayerAdded:Connect(function(player), Which is wrong you are supposed to put game.Players.PlayerAdded:Connect(function(player). Please do some research before asking next time.

2 comments

0

sorry i got confused

0

It's alright

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