Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Values is not a valid member of Script?

Asked by 2 years ago
Edited 2 years ago

I followed a youtube tutorial on a tycoon series and made a tycoon backup script. So, when the player leaves the text on the owner door should go back to "Claim Tycoon" but it's not doing that. It goes back to the owner that previously owned the tycoon.

Here's the script

   game.Players.PlayerRemoving:Connect(function(Player)
      local TycoonFolder = game.Workspace.Tycoons
   for i, v in pairs(TycoonFolder:GetChildren()) do
    if v.Values.OwnerValue.Value == Player then
        local TycoonClone = game.ReplicatedStorage:FindFirstChild(v.Name)
        v:Destroy()
        wait()
        TycoonClone.Parent = TycoonFolder
    end
end
   end) 

Answer this question