I need help with my leaderstats script

For some reason the script is not working.
I cant seem to spot the problem.
Feedback?

and

local status = script.StatusBar

local values = game.ReplicatedStorage.Values
local ticking_clock = 0

local win amount = 1
local point_amount = 10

while true do

ticking_clock = 15

repeat
	ticking_clock = ticking_clock - 1
	status.Value= "Next KAT Round starting in ".. ticking_clock
	wait(1)
until ticking_clock ==0

status.Value = "Round Starting"

wait(2)	

local selectedMap = game.ReplicatedStorage.Maps:GetChildren()
local chosenMap = math.Random(1, #selectedMap)
currentNumber = 0

for i = 1, #selectedMap do
	currentNumber = currentNumber + 1
	if currentNumber == chosenMap then
		selectedMap[i]:Clone().Parent = game.Workspace
		currentMap = selectedMap[i].Name
		status.Value = "The chose map is "..selectedMap[i].Name
	end
end

wait(3)

local players = game.Players:GetChildren()

for i = 1, #players do
	local randomizedNumber = math.random(1,8)
	players[i].Character.Head.CFrame = CFrame.new(game.Workspace.Teleports["Part"..randomizedNumbver].Posistion)
	players[i].Character.Parent = game.Workspace.playersIngame		
end

ticking_clock = 60

repeat
	ticking_clock = ticking_clock - 1
	status.Value = ticking_clock.." seconds left!"	
	wait(1)
until ticking_clock == 0

if values.WinnerValue.Value ~= "" then
	status.Value = values.WinnerValue.Value.." has won!"
	game.Players[values.WinnerValue.Value].leaderstats.Points	.Value = game.Players[values.WinnerValue.Value].leaderstats.Points.Value + point_amount
	values.WinnerValue.Value = ""
else
	status.Value = "No one has won this round!"

end 

wait(3)

local playersIngame = game.Workspace.plaersIngame:GetChildren()

for i = 1, #playersIngame do
	local plr = game.Players:GetPlayerFromCharacter(PlayersIngame[i])
	plr:LoadCharacter()
end

game.Workspace[currentMap]:Destroy()	

end

Please put this in #help-and-feedback:scripting-support and the reason who you’re script isn’t working because you named the leaderstats folder “Leaderstats”, the l is supposed to be lower-case. It’s also not recommended to use the second parameter of Instance.new()

your leaderstats folder should be named “leaderstats” all lower case, else it wont work

1 Like