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

Why wont this work? I have a script changing the House Level value to 1

Asked by 3 years ago

Why won't this script work? I have a script setting the House Level value to 1, but It says its value isnt 1

player.leaderstats.HouseLevel.Changed:Connect(function()
    if player.leaderstats.HouseLevel == 1 then
        print("Level1")
    end
end)
0
Nevermind I found the Fix, I wasn't finding the HouseLevel.Value I was finding the HouseLevel. Nervousmrmonkey2 118 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago
-- if using normal script the "LocalPlayer" be a "Player", but also if using local script the "Player" be a "LocalPlayer".

Local player = game.Players.LocalPlayer
Local leaderstats = game.Players.LocalPlayer.leaderstats
Local HouseLevel = game.Players.LocalPlayer.leaderstats.HouseLevel.Value

player.leaderstats.HouseLevel.Changed(function()
    if player.leaderstats.HouseLevel = 1 then
        print("Level1")
    end
end)
0
Sorry if things go wrong :( RizkySugihartoYT 36 — 3y
Ad

Answer this question