Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ServerScript not creating ObjectValue?

Asked by 6 years ago
01local plr = script.Parent
02local weapons = plr.plrData.ownedWeapons
03weapons.ChildAdded:Connect(function(newwep)
04    if newwep:IsA("Tool") then
05        local id = newwep:FindFirstChild("ID")
06        local val = Instance.new("ObjectValue",plr)
07        val.Name = "PATH_"..id
08        val.Value = newwep
09    end
10end)

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:

1game.Players.PlayerAdded:Connect(function(nplr)
2    game.ServerStorage.fixInv:Clone().Parent = nplr
3    nplr.fixInv.Disabled = false
4end)
0
scripts don't run in the player object I think Vulkarin 581 — 6y
0
^ Yeah, put your script in ServerScriptService or ReplicatedStorage. exxtremestuffs 380 — 6y

Answer this question