Input fires correctly but then fireserver doesn't

Server Script:

local wepevent = game.ReplicatedStorage.re.wep

wepevent.OnServerEvent:Connect(function(Player, rga, rightarm)

local wep = game:GetService("ReplicatedStorage").Moves.weapon:Clone()

local weld = Instance.new("WeldConstraint")

wep.Parent = Player:WaitForChild("Character")

print("step one complete")

weld.Parent = wep

weld.Part0 = rightarm

weld.Part1 = wep

print("step two")

wep.Position = rga.WorldPosition

end)

Local Script:

local LC = game.ReplicatedStorage.re.wep
ui.InputBegan:Connect(function(input)
	print("ui")
	if input.KeyCode == Enum.KeyCode.Q then
		print("q")
		local rga = rightarm:WaitForChild("RightGripAttachment")
		local wep= character:WaitForChild("wep")
		LC:FireServer(rga, rightarm, print("fired"))
		hitt = true
		wep.Touched:Connect(function(hit)
			if hitt == true then 
				hitevent:FireServer(hit, damage*1.3)
				hitt = false
			end
		end)
	end
end)

I figured out the problem. I was looking for something in the player character that hadn’t spawned yet and that caused the rest of the script to stop. When I moved

local wep= character:WaitForChild("wep")

under

hitt = true

and

Player:WaitForChild("Character") to Player.Character

then everything started to work