Unsure how to fix argument missing error

  1. What do you want to achieve? I want to fix the error at line 21 but I do not know how to fix it

  2. What is the issue? There’s a error in line 21 that I’m not able to fix

  3. What solutions have you tried so far? I’ve looked for solutions but nothing helps!

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local lootable = require(game.ServerStorage:WaitForChild("EmoteTable"))
local Emotes = game.ServerStorage.Emotes

function GetRandomItem()
	local Sum = 0
	for SwordName,Chance in pairs(lootable) do
		Sum += Chance
	end
	local RandomNumber = math.random(Sum)
	for SwordName,Chance in pairs(lootable) do
		if RandomNumber <- Chance then
			return SwordName
		else
			RandomNumber -= Chance
		end
	end
end

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local Item = Emotes:FindFirstChild(GetRandomItem()):Clone()
		Item.Parent = Player.Backpack
	end)
end)

Screen Shot 2021-06-18 at 9.03.18 PM

it might be this use <= instead

1 Like

thanks you solved my problem! I was so worried that i couldnt add a loot table sytem