local Character=script.Parent.Parent.Parent.Parent.Character local Build=script.Parent.Parent.Parent.Parent.Parent.Parent.Workspace.Build wait(1) Character.OwnsBuild.Changed:connect(function() local table = game.Workspace:GetChildren() for i,v in pairs (table) do if v.Name == "Build" then print("Model Detected") if v.Owner.Value ==("Player") then print(v.Owner.Value) local Cashtie=v.Cash print(Cashtie) script.Parent.Text="Cash: $"..Cashtie.Value Cashtie.Changed:connect(function(NewValue) if Cashtie.Parent.Owner.Value==script.Parent.Parent.Parent.Parent then script.Parent.Text="Cash: $" ..NewValue end end) else print(v.Owner.Value) end end end end)
My problem is that nothing is running after the line if v.Owner.Value ==("Player") then however after else it prints Player. Someone help? This script is located inside of the text button inside of Playergui btw.
local Character=script.Parent.Parent.Parent.Parent.Character local Build=script.Parent.Parent.Parent.Parent.Parent.Parent.Workspace.Build wait(1) Character.OwnsBuild.Changed:connect(function() local table = game.Workspace:GetChildren() for i,v in pairs (table) do if v.Name == "Build" then print("Model Detected") if v.Owner.Value.Name ==("Player") then --[[ since Owner is an ObjectValue, comparing it with a string always returned false instead you needed v.Owner.Value.Name == "Player" --]] print(v.Owner.Value) local Cashtie=v.Cash print(Cashtie) script.Parent.Text="Cash: $"..Cashtie.Value Cashtie.Changed:connect(function(NewValue) if Cashtie.Parent.Owner.Value==script.Parent.Parent.Parent.Parent then script.Parent.Text="Cash: $" ..NewValue end end) else print(v.Owner.Value) end end end end)