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

DataReady is never true?

Asked by 9 years ago
script.Parent.MouseButton1Click:connect(function()
    if game.Players.LocalPlayer.DataReady == true then
        local house = game.ReplicatedStorage.AverageHouse:Clone()
        --Miscellaneous code
        game.Players.LocalPlayer:SaveInstance("House", house)
        game.Players.LocalPlayer.PlayerGui.HouseGUI:Destroy()
    else print("wait")
    end
end)

This script is in a button. When I click the button, a house model should show up in workspace and be saved via data persistence. However, it never works because DataReady never becomes true! What's going on here?

1 answer

Log in to vote
0
Answered by 9 years ago

If you are trying to use "DataReady" with a guest (AKA a user with a "UserId" less then 0) then that user's "DataReady" property will never equal true!

0
Well, that and he never waits for DataReady to become ready, he goes straight into the if then statement. Also, I believe DataReady works on Guests, it just returns nil keys and values (though I could be wrong). M39a9am3R 3210 — 9y
0
Last time I checked, WaitForDataReady was broken and I had to resort to a repeat loop until DataReady was true. Spongocardo 1991 — 9y
Ad

Answer this question