So I have a little problem (actully big), I did try for a week to find something to fix it.

I will put a text behind whats not working I mean everything works fine, but it doesn't work in a public server only in studio when playing solo. (The leaderstats are broken in the public server)

Here we go the masterscript of my own minigames/waves script (Just 5 waves yet but you only will see 1 in this script otherwise it was to big.) Before looking at the script i leaved some parts away, only the parts of the more waves .

Because of the player can't be find in a public server.. Is their a way to let it work for all players?

local A = "Map1"
local B = "Map2"
local C = "Map3"
local D = "Map4"
local E = "Map5"
local Lighting = game.ServerStorage
local Choos = 0
local player = game.Players:GetChildren() --Solo works fine but public it stop working so nothing works. 

game.Players.PlayerAdded:wait()

while true do
	Choos = math.random(1)
	for i = 25, 0, -1 do
   	wait(1)
    player[i].leaderstats.TimerZ.Value = i --Because of the player can't be find in a public server.. Is their a way to let it work for all players?
	end
	if Choos == 1 then
		game.Players[player].leaderstats.Mappy.Value = game.Players[player].leaderstats.Mappy.Value +1
		Lighting:findFirstChild(A):clone().Parent = game.Workspace
		wait (0.5)
		game.Players[player].leaderstats.Waves.Value = game.Players[player].leaderstats.Waves.Value +1
		Lighting:findFirstChild("M1W1"):clone().Parent = game.Workspace
		for i, v in   pairs(game.Players:GetChildren()) do  v.Character.Torso.CFrame = CFrame.new(Vector3.new(-37.161, 43.18, 72.114))	
			end
		for i = 60, 0, -1 do
   		wait(1)
    	game.Players.LocalPlayer.leaderstats.TimerZ.Value = i -- Timer + New wave below
		end
		if game.Workspace:FindFirstChild("M1W1") then
		for i, v in   pairs(game.Players:GetChildren()) do  v.Character.Torso.CFrame = CFrame.new(Vector3.new(-40.361, 138.18, 62.914))	
			end
		game.Workspace:FindFirstChild(A):Destroy() 
		else
		game.Players[player].leaderstats.Waves.Value = game.Players[player].leaderstats.Waves.Value +1
		game.Players.LocalPlayer.leaderstats.Points.Value = game.Players.LocalPlayer.leaderstats.Points.Value + 1
		for i, v in   pairs(game.Players:GetChildren()) do  v.Character.Torso.CFrame = CFrame.new(Vector3.new(-37.161, 43.18, 72.114))	
			end
		for i = 60, 0, -1 do
   		wait(1)
    	game.Players.LocalPlayer.leaderstats.TimerZ.Value = i -- Timer + New wave below
		end
		end
		wait (1)
	end
end

Can someone help me? Thank you

2 comments

0

you isnt told us wat youre littel problem is.

0

Oops, I mean the leaderstats are broken like the timer down (Works on a leaderboard) and the points. Its not working because line 08 thats what ithinks but how can I make it work?