Why Isn't Player Size Going Down To Normal

Hello!! I need help making my humanoid size go down to normal. (I am making a simulater game and when you collect a berry you get bigger) I have no errors. (According to dev console) Here is my script

–Serverscript
game.ReplicatedStorage.Rebirth.OnServerEvent:Connect(function(player)

player.leaderstats.Bigness.Value = 0
player.leaderstats.Stomps.Value = 0
player.leaderstats.Rebirth.Value = player.leaderstats.Rebirth.Value + 1 

local Humanoid = player.Character:WaitForChild("Humanoid", 3)
local HS = Humanoid.HeadScale
local BDS = Humanoid.BodyDepthScale
local BWS = Humanoid.BodyWidthScale
local BHS = Humanoid.BodyHeightScale

HS.Value = 1
BDS.Value = 1
BWS.Value = 1
BHS.Value = 1

script.Parent.Parent.StarterGui.Lots.Texts.Text = "Successfully Rebirthed"
wait(1.5)
script.Parent.Parent.StarterGui.Lots.Texts.Text = " "

end)

Hi! Can you test this in studio with the output open and let me know of any errors?

I said there was no errors in the dev counsel

1 Like

What do you mean by “dev console”? Are you talking about the output?

Yes that is what I meant. Sorry if I was unclear

That’s ok. Give me a moment to check the script.

You’re getting the StarterGui, not the PlayerGui

Change it to:

player.PlayerGui.Lots.Texts.Text = "Successfully Rebirthed"
wait(1.5)
player.PlayerGui.Lots.Texts.Text = ""

@AmphibionPlayzDev
I’d also recommend debugging with print() statements to check what works and what doesn’t in your Output:

game.ReplicatedStorage.Rebirth.OnServerEvent:Connect(function(player)
    print("Event fired")
    player.leaderstats.Bigness.Value = 0
    player.leaderstats.Stomps.Value = 0
    player.leaderstats.Rebirth.Value = player.leaderstats.Rebirth.Value + 1 

    print("Finding humanoid")
    local Humanoid = player.Character:WaitForChild("Humanoid", 3)
    local HS = Humanoid.HeadScale
    local BDS = Humanoid.BodyDepthScale
    local BWS = Humanoid.BodyWidthScale
    local BHS = Humanoid.BodyHeightScale

    HS.Value = 1
    BDS.Value = 1
    BWS.Value = 1
    BHS.Value = 1
    print("Changed size back to default")

    player.PlayerGui.Lots.Texts.Text = "Successfully Rebirthed"
    wait(1.5)
    player.PlayerGui.Lots.Texts.Text = ""
end)

did you try looking at the value values in the explorer/properties panel after the function ran, on the server? to make sure that they were really actually set to 1

i do not get what you are saying @Bisoph

do you want to see my explorer??

go into the game and do the rebirth. then go into the explorer panel and look at the BodyDepthScale stuff, and check if their values are set to one. if they aren’t set to 1 then something is wrong with your code. or the character respawned while the rebirth was taking place.

and also as jackscarlett said try doing the stuff with print

ok. Also @JackscarIitt the script got to Event Fired

Chances are your leaderstats object is defined as nil or something, try this:

game.ReplicatedStorage.Rebirth.OnServerEvent:Connect(function(player)
    print("Event fired")
    local leaderstats = player:WaitForChild("leaderstats")
    leaderstats.Bigness.Value = 0
    leaderstats.Stomps.Value = 0
    leaderstats.Rebirth.Value += 1 

    print("Finding humanoid")
    local Humanoid = player.Character:WaitForChild("Humanoid", 3)
    local HS = Humanoid.HeadScale
    local BDS = Humanoid.BodyDepthScale
    local BWS = Humanoid.BodyWidthScale
    local BHS = Humanoid.BodyHeightScale

    HS.Value = 1
    BDS.Value = 1
    BWS.Value = 1
    BHS.Value = 1
    print("Changed size back to default")

    player.PlayerGui.Lots.Texts.Text = "Successfully Rebirthed"
    wait(1.5)
    player.PlayerGui.Lots.Texts.Text = ""
end)

this did not work. it is still at event fired

Are you getting anything else from your Output at all? Or just that 1 print statement?

it is getting to just that 1 print statement

Alright the error must lie somewhere to where you defined your leaderstats then, double-check & make sure that you did name your leaderstats object correctly & that all of the Values inside are valid

ok let me look into that (BTW i am defining 2 different leaderstats to get rebirthed)

That’s probably why, resort to only using 1 leaderstat object and parent the Rebirth Value inside there & try it again

so for now i should get rid of Stomps?