Im trying to make a tagging system for a sword fighting game but i get a problem saying that its not a string value when i try to give the player a tag value i put a string value which is the player who hit the other person here is my code:
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if (h~=nil) then
local thisplr = game.Players:findFirstChild(h.Parent.Name)
print(thisplr)
print("name found")
if (thisplr~=nil) then
local stats = thisplr:findFirstChild("playerdata")
print("leaderstats found")
if (stats~=nil) then
local score = stats:findFirstChild("Tagged")
print("value found")
if (score~=nil) then
local plrname = script.Parent.Parent.Name
game.Players[thisplr].playerdata.Tagged.Value = plrname
print("tagged")
end
end
end
end
end
script.Parent.Handle.Touched:connect(onTouched)

1 comment
Output?