Weird bug that I don't know how to classify

Good evening developers. While working on a game, I ran into this weird bug that I don’t really know how to explain. So I have 2 strings that I’m sending by a remote event to a server script, and it changes. So I’ll just show you.

Local Script:

 
local function equipArmor(armorTool)
	if not selectedItem:FindFirstChild("isArmor") then return end
	
	local isArmor = selectedItem:WaitForChild("isArmor")
	local selectedArmorName = isArmor.Value
	local armorType = isArmor:WaitForChild("armorType")
	local armorTypeValue = armorType.Value
	
	local selectedArmor = armorItems:WaitForChild(selectedArmorName)
	local selectedArmorType = selectedArmor:WaitForChild(armorTypeValue)
	
	print(selectedArmor,selectedArmorType)
	
	eventsFolder:WaitForChild("ArmorEquipEvent"):FireServer(selectedArmor,selectedArmorType)
end

Server Script:

local armorEquipEvent = events:WaitForChild("ArmorEquipEvent")
game:GetService("Players").PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local humanoid = character:WaitForChild("Humanoid")
		local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
		local head = character:WaitForChild("Head")
		local torso = character:WaitForChild("Torso")
		local leftArm = character:WaitForChild("Left Arm")
		local rightArm = character:WaitForChild("Right Arm")
		local leftLeg = character:WaitForChild("Left Leg")
		local rightLeg = character:WaitForChild("Right Leg")
		armorEquipEvent.OnServerEvent:Connect(function(selectedArmorFRE,selectedArmorTypeFRE)
			print(selectedArmorFRE,selectedArmorTypeFRE)
		end)
	end)
end)

fhybdfht

Thanks for the help. I genuinely appreciate it.

1 Like

OnServerEvent’s first paramiter is allways the player that fired the event

2 Likes

the reason why its showing your username is because its giving you the player variable too, change your OnServerEvent to this:

armorEquipEvent.OnServerEvent:Connect(function(player,selectedArmorFRE,selectedArmorTypeFRE)
			print(selectedArmorFRE,selectedArmorTypeFRE)
		end)
1 Like