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

Can anyone fix my LeaderBoard Error?

local C = {}

function saveScore(player, score, name)
	player:SaveNumber(name, score)
end
function ADDSTUFF(Ply)

	local Dis = Instance.new("NumberValue", Ply)
	Dis.Name = "District"

	local InA = Instance.new("BoolValue", Ply)
	InA.Name = "InArena"
	local InA2 = Instance.new("BoolValue", Ply)
	InA2.Name = "InArena2"

	local Hunger = Instance.new("NumberValue", Ply)
	Hunger.Name = "Hunger"
	Hunger.Value = 100
	local Thirst = Instance.new("NumberValue", Ply)
	Thirst.Name = "Thirst"
	Thirst.Value = 100
	local Exp = Instance.new("NumberValue", Ply)
	Exp.Name = "Exp"
	local Lvl = Instance.new("NumberValue", Ply)
	Lvl.Name = "Lvl"
	Lvl.Value = 1
	local Points = Instance.new("NumberValue", Ply)
	Points.Name = "Points"
	Points.Value = 0

	local TiG = Instance.new("NumberValue", Ply)
	TiG.Name = "TimeInGame"

	local Age = Instance.new("StringValue", Ply)
	Age.Name = "Age"
	Age.Value = "Unknown"
	local Gender = Instance.new("StringValue", Ply)
	Gender.Name = "Gender"
	Gender.Value = "Unknown"

	local FoodMessage = Instance.new("StringValue", Ply)
	FoodMessage.Name = "FoodMessage"
	local LevelMessage = Instance.new("StringValue", Ply)
	LevelMessage.Name = "LevelMessage"

	local A = game.Lighting.Info:Clone()
	A.Parent = Ply.PlayerGui

	Ply:WaitForDataReady()
	Exp.Value = Ply:LoadNumber("ExpSave")
	Lvl.Value = Ply:LoadNumber("LvlSave")
end

function onPlayerRemoving(player)
		for a,v in pairs(shared.Tributes) do
			if v == player then
			table.remove(shared.Tributes,a)
		end
	end
	local exp = player:findFirstChild("Exp")
	local lvl = player:findFirstChild("Lvl")
	if exp then saveScore(player, exp.Value, "ExpSave") end
	if lvl then saveScore(player, lvl.Value, "LvlSave") end
end

delay(0, function()
		while true do
		wait()
			for A,B in pairs(game.Players:GetChildren()) do
				if not B:findFirstChild("InArena") then
				ADDSTUFF(B)
			end
		end
	end
end)
game.Players.PlayerRemoving:connect(onPlayerRemoving)

Error on line 7, and 65.

3 comments

0

Anything in the output?

0

What is the problem exactly? How is it not working? Was there any Output? If so, what did it say? These Questions are important so that you can get a legitimate Answer, and to prepare us to help you with your problem (Answer your Question, in other words).

0

:o a hunger games??

1 answer

Possibly remove the space on line 7.

4 comments

0

I will try

0

White space do not cause errors, unless if there's an ambiguous syntactical error. But in this case, the white space is fine.

0

What else could cause the error on line 7?

0

White space doesn't really matter in Lua (except for the ones between words!!), you can technically cram many parts of this into 1 line without error.

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