OwnerName = script.Parent.Parent.Parent.Owner.Value
while true do
if script.Parent.Parent.Parent.Injuries.Value > 35 then
wait (1)
script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Players[OwnerName].PlayerGui.VisitorPopup.TextButton.Visible = true
script.Parent.Head.Transparency = 0
script.Parent.Head.CanCollide = true
print ("Call Visitor to office appeared!")
return false
else
wait (1)
end
end
I receive an error trying to use the value of Owner as OwnName when referring to the players. "bad arguement #2 to '?' (string expected, got nil)
Ideally, the script is supposed to take the value of owner, set that as "OwnerName" and use it when referencing Players so the GUI would only appear on that specific player's screen.
I think the error is coming from the fact that Owner.Value is an ObjectValue instead of a StringValue, but for the purposes of what I'm trying to do, I cannot change it to a string. Is there any other way to make this work?
