I am making a pet in Roblox Studio but I can't find a way to find the owner in workspace and follow them. I know how to make the value change once a player touches a part but not when the pet follows the person in workspace that has the same name as the StringValue value.
Script:
local Owner = script.Parent.Owner.Value
local OwnerFollow = game.Workspace:FindFirstChild(Owner)
while true do
wait(5)
print(OwnerFollow)
end
I tried to make it print the owners name but it would just come up with nil
How do I make it find the person in workspace with same value as the value and follow them.

6 comments
maybe do
script.Parent.Owner.NameWorkspace.Bunny Morph.SnowBunny.Follow:7: attempt to index nil with 'Name'
Check if it exists before assuming it does.
still doesnt work... now it just prints nothing in the output
script.Parent.Owner is nil, check if it exists when you play it
still not working