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

Making script, when I try to add a value with another value, it doesn't add it, help?

Asked by 4 years ago

So I made a script of sorts.


local function onPlayerJoin(player) local Noob = Instance.new("Folder") Noob.Name = "Noob" Noob.Parent = player local Noobs = Instance.new("IntValue") Noobs.Name = "Noobs" Noobs.Value = 0 Noobs.Parent = Noob local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local CurrentResets = Instance.new("IntValue") CurrentResets.Name = "Current Resets" CurrentResets.Value = 0 CurrentResets.Parent = leaderstats local Resets = Instance.new("IntValue") Resets.Name = "Resets" Resets.Value = Resets.Value Resets.Parent = leaderstats local UltimateResets = Instance.new("IntValue") UltimateResets.Name = "Ultimate Resets" UltimateResets.Value = 0 UltimateResets.Parent = leaderstats player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").Died:Connect(function() print(Noobs.Value) CurrentResets.Value = CurrentResets.Value + 1 + Noobs.Value Resets.Value = Resets.Value + 1 + Noobs.Value end) end) end game.Players.PlayerAdded:Connect(onPlayerJoin)

The main part I'm concerned about is this.

    player.CharacterAdded:Connect(function(character)
        character:WaitForChild("Humanoid").Died:Connect(function()
            print(Noobs.Value)
    CurrentResets.Value = CurrentResets.Value + 1 + Noobs.Value
    Resets.Value = Resets.Value + 1 + Noobs.Value

If the Noobs.Value is 1, it still counts it as 0. Any fix? No errors.

0
oh now i see whats wrong 3wdo 198 — 4y
0
sorry i cant fix 3wdo 198 — 4y
0
I don't see anywhere in this script that Noobs.Value is ever being set aside from being initialized to 0. EmilyBendsSpace 1025 — 4y
0
It's in a different script. ScottVulpes 105 — 4y

Answer this question