function tagHumanoid(humanoid)
local creator = Instance.new("StringValue",b)
creator.Name = "creator"
creator.Value = game.Players[script.Parent.Parent.Parent.Parent]
creator.Parent = humanoid
end
First of all, don't put all the code on one line like that. Not sure if you did that on accident, but it breaks the code..
Secondary, you are trying (Not successfully doing so) to set the value of a StringValue to a Player Object. This is not possible, the value has to be a string. You either have to use an object value, or set the value to the name of player.
Using an object value:
function tagHumanoid(humanoid)
local creator = Instance.new("ObjectValue")
creator.Name = "creator"
creator.Value = game.Players[script.Parent.Parent.Parent.Parent]
creator.Parent = humanoid
end
Using a string as value:
function tagHumanoid(humanoid)
local creator = Instance.new("StringValue")
creator.Name = "creator"
creator.Value = script.Parent.Parent.Parent.Parent.Name
creator.Parent = humanoid
end
Btw, setting the parent of the value to b seems to be unnecessary, as it is parented somewhere else later on. You can change properties of objects even if they are not parented. Not having access to the full scripts I cannot tell if anything depends on these being parented to b, so you can always change it back in case something breaks.
1 comment
Didn't work :/