Wins system script not working!

go look at my past messages, i sent the leaderstats script earlier

In that case, he probably didnt put it in

still not working and it seems to be adding decimals to my jump script wich i will send here:

game.Players.PlayerAdded:Connect(function(player)
	-- Player joins
	player.CharacterAdded:Connect(function(character)
		character.Humanoid.UseJumpPower = true
		character.Humanoid.JumpPower = 10
	end)
end)

-- Loop runs every 1 sec!
-- loop through	all the players currently
-- increase power

while task.wait(1) do
	-- Any code will run every second
	print("+1 Jump power!")
	for _, player in pairs(game.Players:GetPlayers()) do
		if player.Character then
			-- any code in here will only run if character exists
			player.Character.Humanoid.JumpPower += 10
		end
	end
end	

--Credits to alvin blox as it was a tutorial...

Have all 4 of @IceStorm775 scripts aswell as this script.

dont use that script, it will mess with the script i sent

1 Like

Yea, like @PaleNoobs said, could you send the actual script where you are creating the leaderstats object; maybe you didn’t spell ‘leaderstats’ correctly (incorrect capitalization probably)

hes using the script i sent earlier, he just hadn’t put it in serverscriptservice at the time

game.Players.PlayerAdded:Connect(function(plr)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = plr

	local Jump = Instance.new("NumberValue")
	Jump.Name = "JumpPower"
	Jump.Parent = leaderstats

	local Wins = Instance.new("NumberValue")
	Wins.Name = "Wins"
	Wins.Parent = leaderstats

	plr.CharacterAdded:Connect(function(char)
		while wait(1) do
			Jump.Value += 1
			plr.Character.Humanoid.JumpPower = Jump.Value
		end
	end)
end)
1 Like

If OP used this script, they shouldn’t be getting the error leaderstats is not a valid member of Players.player. Maybe they haven’t yet.

You should also check if the player exists with an if statement

I have used all the scripts but it is getting very confusing now :sweat_smile:

Also gives me this error when i step on the brick:

Could you check if the leaderstats folder is actually in the player on your client?

Could you provide that script that is erroring? It seems like you’re trying to add a integer / number to an object.

put this inside the script thats in the part

local part = script.Parent
local RS = game:GetService("ReplicatedStorage")
local label = game.StarterGui.ScreenGui.Wins.Text
local FireReplicated = true
part.Touched:Connect(function(part)
	if part.Parent:FindFirstChild("Humanoid") then
		local plr = game.Players:FindFirstChild(part.Parent.Name)
		plr.leaderstats.Wins.Value += 1
		RS.GiveWins:FireClient(plr)
	end
end)

Its working now but the jump power wont let me past 3… (on the text label and the actual jump power.)

also here is all the things i have in the game:
image

can i see the script u have in the ‘Jump’ textlabel

1 Like

This is the script and i forgot to include it i think…

Yeah I definatly forgot to include this in the jump power script. sorry.

if you used the leaderstats script i sent you should be able to do

script.Parent.Text = "Jump Power: "..player.leaderstats.JumpPower.Value

could you explain where to put it and i think maybe you need to add tostring to that:
script.Parent.Text = "Jump Power: "..tostring(player.leaderstats.JumpPower.Value)

Yes you’re correct because the “JumpValue” is a number value and NOT a string.

you dont have to in this case but I think it will work aswell, replace line 10 and 5 in the script that you sent me