I dont understand why its not working there is no errors. it was working then something happened
serverstorage = game.ServerStorage.PlayerFolders
game.Players.PlayerAdded:connect(function(player)
if player:FindFirstChild("leaderstats") ==nil then
leaderstats = Instance.new("Model", game.Workspace:FindFirstChild(player.Name))
leaderstats.Name = "leaderstats"
--if game.Workspace[player.Name]:FindFirstChild("Maxhungry") ==nil and game.Workspace[player.Name]:FindFirstChild("Hungry") ==nil then
--maxhungry = Instance.new("IntValue", game.Workspace:WaitForChild(player.Name))
--maxhungry.Name = "Maxhungry"
--maxhungry.Value = 100
--hungry = Instance.new("IntValue", game.Workspace:WaitForChild(player.Name))
--hungry.Name = "Hungry"
--hungry.Value = 100
--end
--if game.Workspace[player.Name]:FindFirstChild("Maxstamina") ==nil and game.Workspace[player.Name]:FindFirstChild("Stamina") ==nil then
--maxstamina = Instance.new("IntValue", game.Workspace:WaitForChild(player.Name))
--maxstamina.Name = "Maxstamina"
--maxstamina.Value = 100
--stamina = Instance.new("IntValue", game.Workspace:WaitForChild(player.Name))
--stamina.Name = "Stamina"
--stamina.Value = 100
--end
end
if serverstorage ~=nil and serverstorage:FindFirstChild(player.Name) ==nil then
Instance.new("Model", serverstorage).Name = player.Name
pp = game.ServerStorage.PlayerFolders:WaitForChild(player.Name)
if pp:FindFirstChild("Bounty") ==nil then
Instance.new("IntValue", pp).Name = "Bounty"
if player:FindFirstChild("Bounty") ==nil then
pp.Bounty:Clone().Parent = player:WaitForChild("leaderstats") end
end
if pp:FindFirstChild("Devilfruit") ==nil then
Instance.new("StringValue", pp).Name = "Devilfruit"
end
if pp:FindFirstChild("Beli") ==nil then
Instance.new("IntValue", pp).Name = "Beli"
end
if pp:FindFirstChild("Banking") ==nil then
Instance.new("IntValue", pp).Name = "Banking"
end
if pp:FindFirstChild("Race") ==nil then
Instance.new("StringValue", pp).Name = "Race"
end
if pp:FindFirstChild("aHaki") ==nil then
Instance.new("StringValue", pp).Name = "aHaki"
end
if pp:FindFirstChild("Treasure") ==nil then
treasure = Instance.new("Model", pp)
treasure.Name = "Treasure"
if treasure:FindFirstChild("Pearl") ==nil then
Instance.new("IntValue", treasure).Name = "Pearl"
end
if treasure:FindFirstChild("Gold") ==nil then
Instance.new("IntValue", treasure).Name = "Gold"
end
if treasure:FindFirstChild("Jewelery") ==nil then
Instance.new("IntValue", treasure).Name = "Jewelery"
end
end
end -- serverstorage
while true do wait() player:WaitForChild("leaderstats").Bounty.Value = pp.Bounty.Value end
end)
game.Players.PlayerRemoving:connect(function(player)
print(player.Name.." left")
serverstorage[player.Name]:remove()
end) |