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

I am a noob at scripting and don't know what this means. Help please?

Error message says..

20:56:47.123 - ServerScriptService.Main:161: invalid argument #3 (Vector3 expected, got nil)

-- CHARACTER CUSTOMISATION --

-- GIRL SHIRTS --

game.ReplicatedStorage.Events.GirlShirt1.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://5315143625"
end)

game.ReplicatedStorage.Events.GirlShirt2.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://4644327745"
end)

game.ReplicatedStorage.Events.GirlShirt3.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://5315093915"
end)

game.ReplicatedStorage.Events.GirlShirt4.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://5308731635"
end)

game.ReplicatedStorage.Events.GirlShirt5.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://3403732010"
end)

game.ReplicatedStorage.Events.GirlShirt6.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = ""
end)

-- BOYS SHIRTS --

game.ReplicatedStorage.Events.BoyShirt1.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://2651916502"
end)

game.ReplicatedStorage.Events.BoyShirt2.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://5311993149"
end)

game.ReplicatedStorage.Events.BoyShirt3.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://5313649132"
end)

game.ReplicatedStorage.Events.BoyShirt4.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://4568240434"
end)

game.ReplicatedStorage.Events.BoyShirt5.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://5304240166"
end)

game.ReplicatedStorage.Events.BoyShirt6.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://2169022476"
end)

-- GIRL PANTS --

game.ReplicatedStorage.Events.GirlPants1.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Pants").PantsTemplate = "rbxassetid://2665843581"
end)

game.ReplicatedStorage.Events.GirlPants2.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Pants").PantsTemplate = "rbxassetid://4245235983"
end)

game.ReplicatedStorage.Events.GirlPants3.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Pants").PantsTemplate = "rbxassetid://5315003009"
end)

game.ReplicatedStorage.Events.GirlPants4.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Pants").PantsTemplate = "rbxassetid://5315146026"
end)

game.ReplicatedStorage.Events.GirlPants5.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Pants").PantsTemplate = "rbxassetid://5311186896"
end)

-- BOY PANTS --

game.ReplicatedStorage.Events.BoyPants1.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Pants").PantsTemplate = "rbxassetid://5312801309"
end)

game.ReplicatedStorage.Events.BoyPants2.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Pants").PantsTemplate = "rbxassetid://5313169268"
end)

game.ReplicatedStorage.Events.BoyPants3.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Pants").PantsTemplate = "rbxassetid://5311984937"
end)

game.ReplicatedStorage.Events.BoyPants4.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Pants").PantsTemplate = "rbxassetid://561126133"
end)

game.ReplicatedStorage.Events.BoyPants5.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	
	char:FindFirstChild("Pants").PantsTemplate = "rbxassetid://3098771410"
end)

-- GIRL HAIR --

game.ReplicatedStorage.Events.GirlHair1.OnServerEvent:Connect(function(plr)
	
	local StorageGirl = game.ReplicatedStorage.Hair.Girl.GirlHair1
	local char = plr.Character
	
	if char:FindFirstChild("Humanoid") then
		
		local Folder = char.Head.Hair
		
		Folder:ClearAllChildren()
		
		local Head = char.Head
		local NewGHair = StorageGirl:Clone()
		local HairWeld = char.Head:GetChildren("HairWeld")
		
		NewGHair.Parent = Folder
		NewGHair.Position = HairWeld.Position
		local Weld = Instance.new("Weld")
		Weld.Parent = NewGHair
		Weld.Part0,Weld.Part1 = Head, NewGHair
		Weld.C0 = CFrame.new()(0,0.6,0)
		Weld.C1 = Head.HairAttachment.CFrame
		
	end
end)

I suck at scripting and don't know what to do, any help please..?

1 comment

0

I might have missed it but did you make a variable for the player

1 answer

i would recommend actually trying to solve your problem before just pasting your code into scripting helpers and hoping for the best. however, ill send you in the right direction

the error means that there is no position for the script to read; nil = 0 in essence

the reason why its doing this is because welds dont have a position property in them, so you will have to try something else.

here's the wiki article for welds:

https://developer.roblox.com/en-us/api-reference/class/Weld

good luck

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