you don’t need any other script as of now, but in case you will need them later, you can just simply disable them for now and test if this one works.
am i supposed to have it in r15 or r6?
(still not working)
that script should be placed in ServerScriptService as PlayerAdded event is useless there, everything from StarterPlayerScripts gets placed into the Player once they join, so it won’t run until the Player loads with all the scripts, you could’ve also done this via LocalScript but it’s alright now, also, can you let us know if you get any errors in the output?
and yes, it should be:
local jumpCount = Instance.new("IntValue")
jumpCount.Name = "Jumps"
jumpCount.Parent = leaderstats
and not
local jumpCount = Instance.new("IntValue")
jumpCount.Name = "Jumps"
it is correct but you forgot to parent it.
You forgot to parent Jumps to Leaderstats
There isn’t an instance called “Jumps”, it should be:
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
and not what you currently have, which is:
local leaderstats = Instance.new("Jumps")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
please don’t change anything other than this and you should be good to go.
Make the F uppercase in folder
I think the event is called StateChanged
, and not StateChange
. Put a “d” at the end and it should be fixed
put a d at the end of this?
yes. (30characarters34421gfhfgh
works! but VERY unresponsive. I did 20 jumps and it said I did 4
example of that:
robloxapp-20200322-1208291.wmv (4.1 MB)
Maybe this way will work better:
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if humanoid.Jump == true then
jumpCount.Value = jumpCount.Value + 1
end
end)
Replace your old character added function to this, and let me know if it works.
when held space bar it gives 2 per jump
Maybe add a cooldown? Like this:
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
local debounce = true
humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if debounce == true then
debounce = false
if humanoid.Jump == true then
jumpCount.Value = jumpCount.Value + 1
end
wait(0.2)
debounce = true
end
end)
like that?
Yep, this would give it an 0.2 second cooldown. Maybe the problem was that it sometimes fires twice rapidly.
but now the leaderboard wont show.