Cant find model whinch name is similar to value

  1. Hi,i want to make script that finds model which name is similar to Player.OwnedTycoon.Value

2.But when i press the button (print(PlrTycoon) is in the script) it prints “nil” in output
but model exists in workspace

  1. Other details are in the script
    script:
local Tycoons = game.Workspace.Tycoon.Tycoons --- it is model located in workspace
local OwnedTycoon = Player.OwnedTycoon ---Whinch tycoon plr has owned it is in the player

script.Parent.MouseButton1Click:Connect(function() --- click button
	
	local PlrTycoon = Tycoons:FindFirstChild(OwnedTycoon.Value) --- i want to find model similar to player.ownedtycoon.value
	if OwnedTycoon then
		print(PlrTycoon)--- but i doesn't print player's tycoon it prints "nil" , so i can't find model whinc name is similar to ownedtycoon.value
		
	end
end)

OwnedTycoon is a value?

yes it is in player and it is Object Value

local Tycoons = game.Workspace.Tycoon.Tycoons 
local OwnedTycoon = Player.OwnedTycoon

script.Parent.MouseButton1Click:Connect(function()
	
	local PlrTycoon = OwnedTycoon.Value
	if OwnedTycoon then
		print(PlrTycoon)	
	end
end)

this should work

1 Like

thanks it is working now)
(enough chrs)

niceeeeeee

1 Like