local plr = script.Parent
local weapons = plr.plrData.ownedWeapons
weapons.ChildAdded:Connect(function(newwep)
	if newwep:IsA("Tool") then
		local id = newwep:FindFirstChild("ID")
		local val = Instance.new("ObjectValue",plr)
		val.Name = "PATH_"..id
		val.Value = newwep
	end
end)

Why isn't this ServerScript creating the ObjectValue? It is placed in a Player object. The script is not disabled. If you want the script that clones it into the Player, here you go:

game.Players.PlayerAdded:Connect(function(nplr)
	game.ServerStorage.fixInv:Clone().Parent = nplr
	nplr.fixInv.Disabled = false
end)

2 comments

0

scripts don't run in the player object I think

0

^ Yeah, put your script in ServerScriptService or ReplicatedStorage.