Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

giving more points than expected?

This is a script for the Leader Board and it also the script which gives the points every kill, But sometimes, or mostly every time, it does't give anything and sometimes it gives 3 points not 1.

 game.Players.PlayerAdded:connect(function(player)
 local folder = Instance.new("Folder",player)
 folder.Name = "hiddenstats"
 local currency1 = Instance.new("IntValue",folder)
 currency1.Name = "Points"
 local addedhealth = Instance.new("IntValue",folder)
 addedhealth.Name = "AddedHealth"
 local addedjump = Instance.new("IntValue",folder)
 addedjump.Name = "AddedJump"
 local addedspeed = Instance.new("IntValue",folder)
 addedspeed.Name = "AddedSpeed"
 local usedcurrecy1 = Instance.new("IntValue", folder)
 usedcurrecy1.Name = "UsedPoints"
  
 player.CharacterAdded:connect(function(character)
   character:WaitForChild("Humanoid").Died:connect(function()
    local tag = character.Humanoid:FindFirstChild("creator")
    if tag ~= nil then
	   if tag.Value ~= nil then
		  currency1.Value = currency1.Value + 1 --This is the reward after the player died.
	     end 
	    end
       end)
      end) 
     end)

3 comments

0

is there a way so that it doest give points if you kill the same person u just killed about 5 seconds ago?

0

cant answer? too hard? ask me ;3

0

Use a debounce and while it equals false award them no points. Use a wait for however long you want the debounce to last before setting it to true again. I will post a link in an answer.

1 answer

✓ Accepted answer

Here is the link I promised: Debounce

3 comments

0

wow, i never knew debounce would work on this one

0

but i still have a problem, sometimes it just doest give points?

0

Could you edit the question above to show your new code?

This discussion is preserved as it was. New answers, comments, and votes are closed.