I am designing a loadout system for one of my games, and have encountered a roadblock(s)
this script is in server script service, and even when i can see in the explorer that the specific values did change, the code prints the old ones and wont give the player the tools they have set because of it
code:
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local primary = plr.Primary.Value
local secondary = plr.Secondary.Value
print(primary,secondary)
local primarytool = rep.Tools.Primaries[primary]
local secondarytool = rep.Tools.Secondaries[secondary]
if primarytool then
wait(0.1)
primarytool:Clone().Parent = plr.Backpack
end
if secondarytool then
wait(0.1)
secondarytool:Clone().Parent = plr.Backpack
end
end)
end)```



can someone help me understand whats wrong?