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)
Thanks for the help. I genuinely appreciate it.